Skip to main content
Daedalus321
Known Participant
Dec 19, 2016 9:29 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

5 replies

Daedalus321
Known Participant
Jan 3, 2017 7:31 PM UTC

Thanks very much, William!

Translate
Daedalus321
Known Participant
Jan 3, 2017 7:36 PM UTC

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

Translate
Peter Grainge
Community Expert
Community Expert
Dec 23, 2016 11:07 AM UTC

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

Translate
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
Dec 23, 2016 4:24 PM UTC

Thanks, Peter!

Translate
Willam van Weelden
Inspiring
Dec 31, 2016 10:43 AM UTC

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.

Translate