473,486 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

height of an element and explorer

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

Dec 24 '06 #1
1 1713
On 2006-12-24, as************@gmail.com <as************@gmail.comwrote:
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.
Dec 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
21493
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I...
12
6706
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
5
2894
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has...
2
15883
by: Marek Mänd | last post by:
I have problems with table row height by Internet Explorer6 in xhtml1 css1compat mode document. The table has fixed height and on one TFOOT row the height is set to 'auto' to make it have...
2
6948
by: Marek Mänd | last post by:
I have simple structure like: <div> <h3 style="text-align:center;"> <span style="float:right;">input type="image"/></span> <span style="float:left;">input type="image"/></span> boxes titlebar...
12
10118
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
8
39494
by: brett | last post by:
How can I find the height and width of a webpage? Say I want to make sure someone's webpage is within an 800X600 viewing area. Width is the most important but if I can get width, I should also be...
3
22275
by: =?iso-8859-1?q?Jesper_R=F8nn-Jensen?= | last post by:
I'm working with a requirement to make a selectbox the same height as normal text input elements. (at least for IE7) But in IE the selectbox reacts strangely to the CSS rules. Normally, there...
3
5299
by: Phil Endecott | last post by:
Dear Experts, It looks as if the HTML4 spec does not define a meaning for empty height and width attributes in an IMG element. Moz seems to ignore them, while IE7 sets the dimension to 1 pixel...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.