David
19th Sep 2005, 11:31 am
Don't get me wrong, I love CSS but boy can it be annoying.
I'm currently trying to develop a tabbed global nav menu for the expanded CADTutor website. All was going well, the CSS looks very straightforward and the resulting code rendered perfectly in IE (see below).
http://www.websitearchitecture.co.uk/watson/postimages/css-pah1.gif
I didn't expect any problems because the CSS seemed perfectly logical and the results I expected are the ones I got. Until, that is, I rendered the page in Firefox (see below). Notice the annoying gap to the left of the tab and the option seperators have dropped on pixel.
http://www.websitearchitecture.co.uk/watson/postimages/css-pah2.gif
I thought I'd better check Opera (see below). Same annoying gap but this time the option seperators have dropped 2 pixels.
http://www.websitearchitecture.co.uk/watson/postimages/css-pah3.gif
I know I'm repeating myself here and I'm sure IE is probably wrong and either Firefox or Opera are right but the fact remains that IE is a far more logical browser to render for.
Of course, I'm not going to stop here, even though 85% of my users are using IE, there is now a solid 10% using Firefox. I can't have the site looking broken for 1 in 10 of my visitors. :(
For your utter enjoyment, the relevant CSS is shown below:
.PageHeader .globalnav
{
background-color: #EBECE0;
}
.PageHeader .globalnav ul
{
list-style:none;
padding:9px 15px 4px 15px;
margin:0;
}
.PageHeader .globalnav li
{
display:inline;
text-align:center;
padding: 2px 15px 5px 15px;
margin:0;
}
.PageHeader .globalnav li.sep
{
background: url(Images/nav-sep.gif) top right no-repeat;
}
.PageHeader .globalnav li.here
{
background: url(Images/nav-here.gif) top right no-repeat;
}
.PageHeader .globalnav li a
{
text-decoration:none;
color:#4C5869;
border-bottom:2px none transparent;
}
.PageHeader .globalnav li a:hover
{
border-bottom:2px solid #DA7C20;
}
Note that I do not recommend the use of CSS classes for unique divisions of a page (as used in this code). They should really be IDs but I'm working with an off the peg CMS and I'm not minded to rewrite all the CSS and change every template file. :P
I'm currently trying to develop a tabbed global nav menu for the expanded CADTutor website. All was going well, the CSS looks very straightforward and the resulting code rendered perfectly in IE (see below).
http://www.websitearchitecture.co.uk/watson/postimages/css-pah1.gif
I didn't expect any problems because the CSS seemed perfectly logical and the results I expected are the ones I got. Until, that is, I rendered the page in Firefox (see below). Notice the annoying gap to the left of the tab and the option seperators have dropped on pixel.
http://www.websitearchitecture.co.uk/watson/postimages/css-pah2.gif
I thought I'd better check Opera (see below). Same annoying gap but this time the option seperators have dropped 2 pixels.
http://www.websitearchitecture.co.uk/watson/postimages/css-pah3.gif
I know I'm repeating myself here and I'm sure IE is probably wrong and either Firefox or Opera are right but the fact remains that IE is a far more logical browser to render for.
Of course, I'm not going to stop here, even though 85% of my users are using IE, there is now a solid 10% using Firefox. I can't have the site looking broken for 1 in 10 of my visitors. :(
For your utter enjoyment, the relevant CSS is shown below:
.PageHeader .globalnav
{
background-color: #EBECE0;
}
.PageHeader .globalnav ul
{
list-style:none;
padding:9px 15px 4px 15px;
margin:0;
}
.PageHeader .globalnav li
{
display:inline;
text-align:center;
padding: 2px 15px 5px 15px;
margin:0;
}
.PageHeader .globalnav li.sep
{
background: url(Images/nav-sep.gif) top right no-repeat;
}
.PageHeader .globalnav li.here
{
background: url(Images/nav-here.gif) top right no-repeat;
}
.PageHeader .globalnav li a
{
text-decoration:none;
color:#4C5869;
border-bottom:2px none transparent;
}
.PageHeader .globalnav li a:hover
{
border-bottom:2px solid #DA7C20;
}
Note that I do not recommend the use of CSS classes for unique divisions of a page (as used in this code). They should really be IDs but I'm working with an off the peg CMS and I'm not minded to rewrite all the CSS and change every template file. :P