Ashtagon
2013-09-01, 11:57 AM
I'm considering a theoretical ambiguity in the css font (http://www.w3schools.com/cssref/pr_font_font.asp) definition.
That font property allows for style, variant, and weight to be set in one go. "inherit" is specifically disallowed, which supposedly removes one source of ambiguity, but "normal" is allowed.
Suppose I have the following code:
.myclass { font: italic small-caps bold 20px Arial }
That will set the font to have all three of style, variant, and weight set to "on" (and look mighty ugly). Now suppose I want to turn off two of style, variant, and weight in a line of text inside that class.
.mysubclass { font: normal normal 20px Arial }
According to the definitions presented, this is valid code. But which two items are turned "off" in this example? Is there any way to set my choice of two of these to "off" while leaving the third undefined?
That font property allows for style, variant, and weight to be set in one go. "inherit" is specifically disallowed, which supposedly removes one source of ambiguity, but "normal" is allowed.
Suppose I have the following code:
.myclass { font: italic small-caps bold 20px Arial }
That will set the font to have all three of style, variant, and weight set to "on" (and look mighty ugly). Now suppose I want to turn off two of style, variant, and weight in a line of text inside that class.
.mysubclass { font: normal normal 20px Arial }
According to the definitions presented, this is valid code. But which two items are turned "off" in this example? Is there any way to set my choice of two of these to "off" while leaving the third undefined?