Margins, padding, and a horizontal scrollbar in WebHelp

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Margins, padding, and a horizontal scrollbar in WebHelp

Post by Craig.Prichard »

If I add any margin-left or padding-left to classes like MadCap|miniTOCProxy a horizontal scrollbar appears at the bottom of the content frame. No matter the width of the browser window before, during, or after the topic is rendered, the horizontal scrollbar is present and remains constant (by the amount of the margin-left and padding-left values). My body tag applies a smidge of padding so the content doesn't press against any edge of the frame:

Code: Select all

body
{
	font-size: 12pt;
	font-style: normal;
	font-weight: normal;
	line-height: 1.12;
	text-decoration: none;
	padding: .75em .5em .25em .5em;
	margin: 0;
	margin-top: 66px; /* to leave room for breadcrumbsProxy and non-scrolling region */
}
What should I do different to ensure I never have a horizontal scrollbar but still be able to use margins and padding freely?
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Margins, padding, and a horizontal scrollbar in WebHelp

Post by lacastle »

Craig.Prichard wrote:What should I do different to ensure I never have a horizontal scrollbar
You can't control the horizontal scrollbar in all instances because user browser settings can change the window size, font size, etc. and override your styles. a smaller window or larger font may require a horizontal scrollbar.

(i don't know about your other concerns)
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Margins, padding, and a horizontal scrollbar in WebHelp

Post by LTinker68 »

Did you change the scrollbar setting for the base div tag in your stylesheet?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Margins, padding, and a horizontal scrollbar in WebHelp

Post by i-tietz »

try this style:

Code: Select all

overflow-x: hidden;
overflow-y: auto;
in the wanted element ...
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Margins, padding, and a horizontal scrollbar in WebHelp

Post by Craig.Prichard »

I have

Code: Select all

body { overflow: auto; }
which seems to work.

* Is body the correct tag to place overflow in?
* How does overflow: auto; differ from overflow-x: hidden; overflow-y: auto;?

Thank you all for your help.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Margins, padding, and a horizontal scrollbar in WebHelp

Post by i-tietz »

Craig.Prichard wrote:* Is body the correct tag to place overflow in?
* How does overflow: auto; differ from overflow-x: hidden; overflow-y: auto;?
overflow: auto; means: whenever the browser reckons it's necessary it applies horizontal scrollbars or vertical scrollbars
overflow-x: hidden; means: never apply horizontal scrollbars
overflow-y: auto; means: whenever the browser reckons it's necessary it applies a vertical scrollbar

And the overflow style can be applied to most HTML elements: You can also apply it to divs, tables, images, ...
Post Reply