Skip to main content
Daedalus321
Known Participant
December 19, 2016
Question

Setting right margin for HTML5 output (master page? layout? css?)

  • December 19, 2016
  • 2 replies
  • 744 views

Hi all,

Currently, my content runs all the way across my widescreen monitor to the right edge of the monitor.

Is there a way to set a right margin so that digital output does not appear in a browser to run the entire horizontal width of the screen?

Or is the only answer to use tables -- to embed all body text in table cells in order to constrain "margins"?

Thanks.

Mark

This topic has been closed for replies.

2 replies

Daedalus321
Known Participant
January 3, 2017

Thanks very much, William!

Daedalus321
Known Participant
January 3, 2017

p.s. That's exactly what I needed -- how to set max width for all elements in all topics, for wide screens. Thanks again.

Peter Grainge
Community Expert
Community Expert
December 23, 2016

Take a look at CSS Margin​. You can apply any or all of the margin styles in your CSS.


See www.grainge.org for RoboHelp and Authoring information

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Daedalus321
Known Participant
December 23, 2016

Thanks, Peter!

Willam van Weelden
Inspiring
December 31, 2016

A margin works if you always want a specific margin on one of the sides. I understand your question as to limit the maximum width of the page so that it only affects wide screens.

In that case, you can set a maximum width to all elements in topics. If you add the following to your CSS:

body { max-width: 1000px; }

The content will be 1000px wide at maximum. But for smaller screens, the content will behave as it always has. You can also apply this to specific elements, for example if paragraphs should be 1000px wide, but tables and images are allowed to become wider.

p, ul, ol { max-width: 1000px; }

will only limit paragraphs, numbered lists and bulleted lists.