473,549 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ 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 1721
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
"overconstraine d" 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
21506
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 know I can use document.defaultView.getComputedStyle() to do this. IE does not support document.defaultView.getComputedStyle(). It supports...
12
6712
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"> <span>Abc</span> <span style="background: white; color: black; line-height: 3">Abc</span> <span>Abc</span> </div>
5
2898
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 been my experience for years and decades. Maybe I'm projecting hostility. I don't know. How can I ask about theory and concepts without offending...
2
15893
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 flexible height, which will shrink if there are more rows in TBODY and which will grow if there are fewer rows in TBODY. However IE6 has huge troubles...
2
6958
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 </h3> <div> box content
12
10136
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 scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a...
8
39503
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 able to get height. I don't need to modify the page in anyway. Just get the width and height. I can reference the page in an iframe, cfhttp...
3
22283
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 are so many things not possible with select boxes in IE. But the I discovered I could actually change the height by adjusting font-size, then...
3
5303
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 (or something like that). I have a vague recollection that "" did have a defined meaning at some point in the past, but maybe I am...
0
7526
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7723
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7965
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7483
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6051
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3487
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
771
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.