HighDots Forums  

height of an element and explorer

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss height of an element and explorer in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
astrochelonian@gmail.com
 
Posts: n/a

Default height of an element and explorer - 12-23-2006 , 09:42 PM






Hello, all,

First time I post, so I beg for everyone's patience.

I am writing because I have the following doubt. in the page
http://atuin.no-ip.org, you can see a blue-grey bar stretching down the
length of the right side of the website. In order to achieve the effect
in IE, I had to add height: 700px (or another outrageously long
number), or else the coloring of the sidebar would stop when the last
item within the sidebar finished (ie: the menu). However, no tweaking
was required with opera and firefox; the bar was painted down the
length of the website.

I would like to know which is the correct behavior, and, if IE is
misbehaving, if there's a better way to produce said effect.

Thank you for your time,

Eduardo Alvarez


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

Default Re: height of an element and explorer - 12-24-2006 , 04:58 AM






On 2006-12-24, astrochelonian (AT) gmail (DOT) com <astrochelonian (AT) gmail (DOT) com> wrote:
Quote:
Hello, all,

First time I post, so I beg for everyone's patience.

I am writing because I have the following doubt. in the page
http://atuin.no-ip.org, you can see a blue-grey bar stretching down the
length of the right side of the website. In order to achieve the effect
in IE, I had to add height: 700px (or another outrageously long
number), or else the coloring of the sidebar would stop when the last
item within the sidebar finished (ie: the menu). However, no tweaking
was required with opera and firefox; the bar was painted down the
length of the website.

I would like to know which is the correct behavior, and, if IE is
misbehaving, if there's a better way to produce said effect.
The rule is that top + height + bottom + total vertical margins, borders
and padding must equal the containing height.

If you set values for most of those properties, the browser fills in the
rest to make them all add up to the containing height (according to
precise rules all in the CSS 2.1 spec).

If you set values for them _all_, though, then the values are
"overconstrained" and the browser has to ignore at least one of the
values you set. In this case that would be the value for bottom.

If you set height to 10px in your example and leave everything else as
it is, you will see that in Firefox you get a height of 10px-- the value
for bottom got discarded.

If IE is doing that part of the spec about right (which we don't know),
the most likely explanation is that IE is mistaken about the containing
height. If you set "bottom: 0", the bottom edge should be at the bottom
edge of the container, which should be the bottom edge of the viewport
in this case, but this relies on the browser getting the containing
height right. If you set "height: 700px" on the other hand, the browser
will give you a height of 700px even if it thinks it's overflowing its
container.

Firefox is showing correct behaviour because the containing block of an
absolutely positioned box is its nearest positioned ancestor or the
viewport if it has no positioned ancestors (which in your case it
doesn't).

So it looks like IE is misbehaving. Your method of producing the effect
is a good one, I don't know the IE workaround.


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 - 2009, Jelsoft Enterprises Ltd.