I'm trying to develop a simple way to display tabs with <ul><li> and <div>.I use float:left on my <li> items to display the tabs horizontally.Then I add 4 <div> elements with special border/margin values to give an effect of round corners on the top of my tabs. With Firefox it works, but with IE, tab width expand to the browser limits. I don't understand why IE is doing this. I know I can fix this by forcing a width value on my tab. But I don't want to because the textual content of the tabs can change.I also know that using images will do the trick. But I prefer the 4 <div> solution since I can modify the colors of the tabs border and background using css.Here is the html:
[size=3][font="Courier New"]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled</title><style type="text/css"><!--.top1, .top2, .top3, .top4 {display : block; overflow : hidden; height : 1px;}.top1 {background : black; margin : 0px 5px; }.top2 {border-right : black 2px solid; border-left : black 2px solid; margin : 0px 3px;}.top3 {border-right : black 1px solid; border-left : black 1px solid; margin : 0px 2px;}.top4 {height : 2px; border-right : black 1px solid; border-left : black 1px solid; margin : 0px 1px;}.tabbar {display : block; height : 25px; padding : 2px 0 2px 5px; list-style-type : none;}.tabtop {display:inline; background : transparent;}.tabbottom {padding: 0px 5px 5px 5px; border-right : black 1px solid; border-bottom : black 1px solid; border-left : black 1px solid;}.tabcontent {padding: 0px 5px 5px 5px; border-top : black 1px solid; border-right : black 1px solid; border-bottom : black 1px solid; border-left : black 1px solid;}.tabbar li { display : block; float : left; margin: 0 3px 3px 3px;}--></style></head><body>[color="#009900"][b] <title1>Without round corners</title1> <ul class="tabbar"> <div style="clear: both"></div> <li> <div class="tabcontent"> <a href="#" onclick="java script:alert('This is Tab A');">Tab A</a> </div> </li> <li> <div class="tabcontent"> <a href="#" onclick="java script:alert('This is Tab B');">Tab B</a> </div> </li> <div style="clear: both"></div> </ul>[/b][/color] [color="#CC0000"][b] <title1>With round corners</title1> <ul class="tabbar"> <div style="clear: both"></div> <li> <div class="tabtop"> <div class="top1"></div> <div class="top2"></div> <div class="top3"></div> <div class="top4"></div> </div> <div class="tabbottom"> <a href="#" onclick="java script:alert('This is Tab A');">Tab A</a> </div> </li> <li> <div class="tabtop"> <div class="top1"></div> <div class="top2"></div> <div class="top3"></div> <div class="top4"></div> </div> <div class="tabbottom"> <a href="#" onclick="java script:alert('This is Tab B');">Tab B</a> </div> </li> <div style="clear: both"></div> </ul>[/b][/color]</body></html>[/font][/size]