I can’t for the life of me get this to work in ANY version of IE. It only displays the navigation as a normal bulleted list, but I know it must be possible based on some findings from CSS3 Please! The Cross-Browser CSS3 Rule Generator such as:
Paul’s technique is probably the best, though I’d suggest tweaking the height to width ratio of top and bottom borders to exactly 1:1, 2:1 or 3:1 – makes the jaggies less annoying.
Going to play with this though… there’s got to be a way to make it work without targeting IE for different margins and line-heights.
Hey, I got it working all the way back to IE 5.5 without IE specific hacks.
Basically same markup as Paul’s, but with this CSS:
html,body,ul,li {
margin:0;
padding:0;
}
ul {
list-style:none;
overflow:hidden;
height:32px;
}
ul li {
display:inline;
}
ul a {
position:relative;
float:left;
padding:8px 0 8px 16px;
margin:0 -13px 0 16px;
text-decoration:none;
color:#444;
background:#FAA;
font:bold 14px/16px arial,helvetica,sans-serif;
}
ul a span {
position:absolute;
top:0;
left:-16px;
border-top:32px solid #FAA;
border-left:16px dashed transparent;
}
ul a b {
display:inline-block;
vertical-align:bottom;
height:16px;
margin:-24px 0 -8px 16px;
border-bottom:32px solid #FAA;
border-right:16px solid #FFF;
}
ul .current a {
background:#8F8;
}
ul .current span {
border-top-color:#8F8;
}
ul .current b {
border-bottom-color:#8F8;
}
ul a:active,
ul a:focus,
ul a:hover {
background:#CCF;
}
ul a:active span,
ul a:focus span,
ul a:hover span {
border-top-color:#CCF;
}
ul a:active b,
ul a:focus b,
ul a:hover b {
border-bottom-color:#CCF;
}
The difference between a descendant selector and a child selector feels much the same to me… especially when I see things like:
#main-nav > ul > li:first-child > a
… on something as simple as a menu - Building the ENTIRE thing on child selectors, and then still hacking it to work in IE using filters?!? Waste of time. Much less building the ENTIRE CSS on nothing BUT child selectors – serious whiskey tango foxtrot territory. Only good thing I can say about the transform method is it doesn’t need two sandbags, and instead uses a nest… Oh noes, 7 characters extra for each one