Forum Moderators: not2easy
.foo {
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size : 1.2em;
font-style : italic;
font-weight : bold;
text-decoration : underline;
text-align : right;
}
.foo {
font: italic bold 1.2em Verdana, Geneva, Arial, Helvetica, sans-serif;
text-decoration : underline;
text-align : right;
}
This is exactly the same as the one you posted. It can be useful for reducing styles file size, and to make it look more compact.
But here order matters! It should be this:
font: <font-style> <font-weight> <font-size> <font-family>
If you do it this way exactly, it will work in all browsers (including old NN4).
As for the reduced length version, my styles are built on-the-fly according to the user's choices, so I'll stick with the longer way as it's less complex to build code for. :)
But here order matters! It should be this:font: <font-style> <font-weight> <font-size> <font-family>
Neither here nor there, and what you list is how I do it, but I've seen the order of the first two reversed in some lists, and it works just the same.
Also, a couple of other properties can be included in this one. A fuller list would be:
<font-style> <font-variant> <font-weight> <font-size>/<line-height> <font-family>
Finally, only the last two are strictly required, which might occasionally save you some typing.
Did you test it in all browsers? I guess you didn't.
I don't believe I've tested the "alternate order" in all the browsers. I didn't see any need to since I have always used the "standard order" you listed (which I did test) without incident.
But when I refer to "lists" I'm speaking of how reference tools state it. I just checked to see if I was just misremembering --Web Design in a Nutshell, p.403 and she (at least the first edition) includes the 'alternate' order, reversing the order of the first two values. It is a bit odd though since she lists it in the standard order at the beginning of the entry, then introduces the alternate order with "must be listed as follows"? A typo maybe?
I will confess, however, that you've made me curious. I'm assuming from your remarks that you have tested the alternate order, and it didn't always work. In my quick tests of current browsers (Netscape 4.74 and 6.2, IE 6.0 and Opera 6.05) both orders displayed the same. So, how far back do I have to go to encounter problems? or is there a problem with some Mac browser version (I have to go out of my way to run tests for Mac's --and don't need to much for those who use our sites)? or. . .?