Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Border layout not closing in IE

Status
Not open for further replies.

cfsponge

Programmer
Feb 22, 2006
44
US
We're using a tableless CSS format for one of our site menus. It's using a combination of 3 DIVs to place images around a menu so that it is boxed in. It works in Firefox but fails in IE and am stumped why. Here's the link:


And here are the style attributes used for it (only showing the non-bg image portions):

.subnavcontainer {position:relative;margin:0 0 1em;padding:0;}
.subnavcontainer div {margin:0;padding:2px 0 0 0;}
.subnavcontainer div div {padding:0 0 0 11px;margin:0;}
.subnavcontainer div div div {padding:0 0px 11px 0;margin: 0px; height:auto!important;height:1%;}

I've tried messing around with the padding and margins to no avail.
 
Sounds like box model trouble. If you have margins and such on a div, IE won't count those when calculating the with and height of it. The only solution is to provide different code for IE, e.g. by linking to a special IE stylesheet between these:
Code:
<!--[if IE]><![endif]-->
 
BillyRayPreachersSon, the second height specification is and IE only box model fix. Using "height:auto!important;height:1%;" allows a minimal height in IE to work correctly since it doesn't recognize the min-height CSS attribute.
 
That doesn't sound right to me - the first height declaration will set the height to auto, the second will set it to 1% - you won't ever have both. You should be able to remove the first without affecting the second.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
However, the first one has the !important added to it, so you could get rid of the second one actually. I guess that could be a fix for some ancient browser that does not support !important.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top