Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: 100% width navbar with padding
IE7
Safari 3
IE6 does not support pseudo-classes, so you can throw some simple JavaScript at it.
edit: The W3Schools demo works fine in Safari 3.
Last edited by jm (2008-01-06 18:10:33)
Offline
Offline
Re: 100% width navbar with padding
Ah. IE<7 support wasn’t mentioned in Joey’s posts, hence non-IE6 demos.
For IE6, just add the following to your HTML:
<!--[if lt IE 7]>
<script type="text/javascript">
function classFirstChild(id, firstElement, firstClass) {
if (!document.getElementById(id)) return;
document.getElementById(id).getElementsByTagName(firstElement)[0].className = firstClass;
}
window.onload = function() {
classFirstChild('nav', 'li', 'first');
};
</script>
<![endif]-->
CSS:
#nav li:first-child, #nav li.first {
background: #faa;
}
I didn’t test in IE6, but it should work.
Offline