473,703 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS "Display:no ne" 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 9607
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:hidd en; instead of display:none;

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

Now playing: Squeeze - Discipline
Jul 20 '06 #2
Els <el*********@ti scali.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:hidd en; 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
40745
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 style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
5
9823
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 the tablerow style property to "None", the row (And embedded table) briefly disappear, but then bounce right back into sight. Any ideas on why it's doing this and how to make the style.display = "None" stick?
3
4480
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/ HTML 4.01 spec: http://www.w3.org/TR/html401/ validator: http://validator.w3.org/ CSS 2.1 spec: http://www.w3.org/TR/CSS21/ validator: http://jigsaw.w3.org/css-validator/
1
1220
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 image without problem, but i can not clear the property if i do not want to use it... to clean the property, i mean by that, to not allocate an image data to it... so it should display (none) as value.
6
29186
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 land, i would like to know if PHP will send hidden HTML form elements or not?... for example: if a user makes a selection in my HTML form that triggers my wonderfully dynamic HTML to set a DIV to STYLE="DISPLAY:NONE", is it possible to tell PHP not...
4
70089
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; aForm.nav_page_name.value = pages.value]; var si = pageElement.selectedIndex;
2
8685
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 with two divs to get them to render side by side: <div style="width:12em;border: 2px solid #EFCE8C; padding: 0.5em;display:inline;">abc</div> <div style="width:12em;border: 2px solid #EFCE8C; padding:
2
1974
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, studied my past suceeding brew and litterally copy and pasted the function but it still refuses to cooperate with me. What am I trying to do? I'll let the code do the talking: function...
0
8758
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8669
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9251
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9017
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7867
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5922
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2450
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2069
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.