HighDots Forums  

100% width element causes scrollbar in IE when dir=rtl

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss 100% width element causes scrollbar in IE when dir=rtl in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
elsigh
 
Posts: n/a

Default 100% width element causes scrollbar in IE when dir=rtl - 12-14-2007 , 04:21 PM






http://www.commoner.com/lsimon/horzscroll_rtl.html

My question is if anyone knows of a way to get an element to expand
across the entire viewport in IE in RTL without setting the body
padding or margin to 0 (I want to leave those to their default for a
variety of reasons). I can't add a container markup piece either or
turn off overflow on body.

Firefox doesn't give a scrollbar here, but that seems to me to be a
bug since the element is extending 200% width into the content area of
the browser (the left hand side for RTL users).

Setting width to 100% seems to work in Opera, but I'm looking for
something which may work for all. In any case, I can come up with a
fix for FF and Opera, but nothing for IE, so I don't mind a
conditional solution.

Any ideas? I've tried a combination of widths with negative margins
and paddings, but had no luck yet..

Reply With Quote
  #2  
Old   
GTalbot
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-15-2007 , 10:01 AM






On 14 déc, 17:21, elsigh <els... (AT) gmail (DOT) com> wrote:
Quote:
http://www.commoner.com/lsimon/horzscroll_rtl.html

My question is if anyone knows of a way to get an element to expand
across the entire viewport in IE in RTL without setting the body
padding or margin to 0 (I want to leave those to their default for a
variety of reasons). I can't add a container markup piece either or
turn off overflow on body.

Firefox doesn't give a scrollbar here, but that seems to me to be a
bug
Hello elsigh,

It is a bug in Firefox and it has been fixed in Firefox 3.

since the element is extending 200% width into the content area of
Quote:
the browser (the left hand side for RTL users).

Setting width to 100% seems to work in Opera, but I'm looking for
something which may work for all. In any case, I can come up with a
fix for FF and Opera, but nothing for IE, so I don't mind a
conditional solution.

Any ideas? I've tried a combination of widths with negative margins
and paddings, but had no luck yet..
Actually, you never need to set width to 100% since width: auto will
use all of the available width. Same thing with margin and padding:
there is no need to set these to 0. Just use the default browser
values and just use width: auto.

Regards, Gérard



Reply With Quote
  #3  
Old   
Bergamot
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-15-2007 , 10:21 AM



GTalbot wrote:
Quote:
Just use the default browser
values and just use width: auto.
Since auto is the default value, you shouldn't need to set width at all.

--
Berg


Reply With Quote
  #4  
Old   
Ben C
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-15-2007 , 10:40 AM



On 2007-12-15, GTalbot <newsgroup (AT) gtalbot (DOT) org> wrote:
[...]
Quote:
Actually, you never need to set width to 100% since width: auto will
use all of the available width.
Almost never. Some elements (floats, positioned boxes, inline blocks)
have "shrink-to-fit" auto width, and so in some circumstances you might
set width: 100% on those.


Reply With Quote
  #5  
Old   
GTalbot
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-16-2007 , 04:17 AM



On 15 déc, 11:21, Bergamot <berga... (AT) visi (DOT) com> wrote:
Quote:
GTalbot wrote:

Just use the default browser
values and just use width: auto.

Since auto is the default value, you shouldn't need to set width at all.

--
Berg
You're right, Berg, but I wanted the OP to understand that there is a
special value which is auto and it's the default.

Many people don't understand width: auto and height: auto and what
each of these declarations means in terms of layout. These are not
obvious declarations either, I mean self-explanatory ones, intuitives
ones. In the mind of beginners, width: 100% is obvious, self-
explanatory.

Regards, Gérard


Reply With Quote
  #6  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-17-2007 , 10:14 AM



elsigh wrote:
Quote:
http://www.commoner.com/lsimon/horzscroll_rtl.html

My question is if anyone knows of a way to get an element to expand
across the entire viewport in IE in RTL without setting the body
padding or margin to 0 (I want to leave those to their default for a
variety of reasons).
Eh? If the body's right margin isn't zero, then you're going to have a
right margin, and your element won't expand across the entire viewport.
You're looking to satisfy two inherently contradictory conditions.



Reply With Quote
  #7  
Old   
Ben C
 
Posts: n/a

Default Re: 100% width element causes scrollbar in IE when dir=rtl - 12-17-2007 , 11:48 AM



On 2007-12-17, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:
Quote:
elsigh wrote:
http://www.commoner.com/lsimon/horzscroll_rtl.html

My question is if anyone knows of a way to get an element to expand
across the entire viewport in IE in RTL without setting the body
padding or margin to 0 (I want to leave those to their default for a
variety of reasons).

Eh? If the body's right margin isn't zero, then you're going to have a
right margin, and your element won't expand across the entire viewport.
You're looking to satisfy two inherently contradictory conditions.
Not necessarily. The box is absolutely positioned, which means its
container is probably actually the "root element" (we don't know for
sure without a URL), which is above body.

So left: 0; width: 100% (or left: 0; right: 0) should span the whole
viewport even if body has lots of margins and padding.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.