473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

CSS "Display:none" Adds Height In IE6?!?!

Hi there

I have quite a bit of experience with CSS but I am stumped by the
following:

http://www.electricphase.com/example/example1.php
(uses http://www.electricphase.com/example/test1.css)

http://www.electricphase.com/example/example2.php
(uses http://www.electricphase.com/example/test2.css)

As you can see, I am using a list (<ul><li>) for my menu, and styling it
to have graphic rollovers, etc. To prevent the actual list items from
appearing overtop my graphic, I have put them in a <spanand given that
a style with display=none. This apparantly causes layout problems in
IE6.

Firefox views those two URLS as identical; IE6 displays the first one
incorrectly (the menu box extends too far). The only difference between
the two pages is one line of CSS; the first page has

..noDisplay { display: none; }

while the second is totally empty: .noDisplay { }
I have tried adding padding 0px/margin 0px/height 0px/etc etc to the
first CSS page's .noDisplay class, but the bottom line is that "display:
none" is throwing the layout out of whack!!! How/Why would "display:
none" actually INCREASE the height of the <li>?? You can actually SEE
the <ligrow by flipping between those pages quickly...

It's crazy!!! Does anyone have a solution or explanation?

Jul 20 '06 #1
2 9572
Els
Good Man wrote:
Hi there

I have quite a bit of experience with CSS but I am stumped by the
following:

http://www.electricphase.com/example/example1.php
(uses http://www.electricphase.com/example/test1.css)

http://www.electricphase.com/example/example2.php
(uses http://www.electricphase.com/example/test2.css)

As you can see, I am using a list (<ul><li>) for my menu, and styling it
to have graphic rollovers, etc. To prevent the actual list items from
appearing overtop my graphic, I have put them in a <spanand given that
a style with display=none. This apparantly causes layout problems in
IE6.

Firefox views those two URLS as identical; IE6 displays the first one
incorrectly (the menu box extends too far). The only difference between
the two pages is one line of CSS; the first page has

.noDisplay { display: none; }

while the second is totally empty: .noDisplay { }

I have tried adding padding 0px/margin 0px/height 0px/etc etc to the
first CSS page's .noDisplay class, but the bottom line is that "display:
none" is throwing the layout out of whack!!! How/Why would "display:
none" actually INCREASE the height of the <li>?? You can actually SEE
the <ligrow by flipping between those pages quickly...

It's crazy!!! Does anyone have a solution or explanation?
Explanation: no, it's weird indeed.
Solution: Use visibility:hidden; instead of display:none;

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Squeeze - Discipline
Jul 20 '06 #2
Els <el*********@tiscali.nlwrote in
news:2i******************************@40tude.net:
>It's crazy!!! Does anyone have a solution or explanation?

Explanation: no, it's weird indeed.
Solution: Use visibility:hidden; instead of display:none;
Excellent, thanks very much.

Jul 20 '06 #3

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
5
by: Sue | last post by:
Help! I have an asp table with an embedded table. The asp tablerow that contains this table has a static ID assigned of "FilterRow2" (see snippets of code below). When I click on the button to set...
3
by: Stan Brown | last post by:
Posted by Pierre Blais in the current RISKS Digest: http://catless.ncl.ac.uk/Risks/24.24.html#subj9 -- Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/...
1
by: --== Alain ==-- | last post by:
Hi, I've seen that on all component it is possible to have (none) as value for a property. Usually i see it for Image or ImageList property type. So tried it on my component. I can set the...
6
chunk1978
by: chunk1978 | last post by:
hi there... i'm about to embark on my very first PHP code journey (i've been saying that for a while... so sometime soon i hope... anyway)... before i begin my exciting new journey into PHP...
4
by: gimme_this_gimme_that | last post by:
Hi, I have an onchange method for a select box that goes something like this (the select is in a form named aForm): function page_on_change() { pageElement = aForm.my_page_id;...
2
by: Steve Richter | last post by:
I would like to use display:inline and other CSS attributes to build an entry form. Where the heading to the left of the text box is always a set width. It is not working so I am experimenting...
2
by: musicmaster890 | last post by:
Okay, I cannot figure this out. I have an external javascript file to declare variables and functions in my <head> element of my HTML. I've done this before and have made it work. And, likewise,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.