Hello Jukka,
Am 25.11.2003 00:51 schrieb Jukka K. Korpela:[color=blue]
> Fabian Neumann <news.for.pporg@spamgourmet.org> wrote:[color=green]
>>I got a problem with font-family inheritance.[/color]
>
> Or with inheritance of font properties in general?[/color]
Just needed family inheritance, since this is mostly constant in
paragraphs where size an weight change. But I can imagine this issue
covers all of them.
[color=blue]
> Browsers often get them wrong; e.g., the principle that the _computed_ value
> is what gets inherited is violated, in different ways, by IE 6 and Opera 7.
>[color=green]
>>p {
>> font:normal 10pt Verdana;
>>}
>>strong {
>> font:normal 14pt inherit;
>>}[/color]
>
> I hope Verdana is just a dummy example here. (If it isn't, you should check
> what has been written about Verdana in this group.) Ditto for the use of the
> pt unit.[/color]
Yes, Verdana is dummy. Actually I'd use "Verdana, sans-serif" at least.
I wanted to make it short. Maybe too short. But what's wrong about
Verdana in general (except that it was introduced as a Microsoft Web
Standard Font)?
I must admit that units are some kind confusing to me. Used to take pt,
since some weeks I prefer % or em, to please users with bigger monitors.
[color=blue]
> W3C's "CSS Validator"
> (
http://jigsaw.w3.org/css-validator/validator-text.html )
> gives odd results. When the Warnings option is set to "No warnings" it says:
> Errors
> URI : file://localhost/TextArea
> Line: 0 Context : strong
> Invalid number : fonttoo few values for the property normal 14pt : normal
> 14pt
>
> Valid CSS information
> p {
> font : normal 10pt Verdana;
> }
>
> But when I set Warnings to "Normal report", I get:
>
> Warnings
> URI : file://localhost/TextArea
> Line : 0 font-family: You are encouraged to offer a generic family as a last
> alternative
> Valid CSS information
> p {
> font : normal 10pt Verdana;
> }
> strong {
> font : normal 14pt;
> }
>
> which seems to say that the style sheet is "valid" in its opinion (no error
> message issued) but it echoes it back without the 'inherit' keyword (thereby
> changing the meaning, in general)!
> Confused? Well, so is the "validator", and so is the specification. See[/color]
Yes :)
[color=blue]
>
http://www.w3.org/TR/REC-CSS2/fonts.html#font-shorthand
> and consider the declaration
> font: inherit 100% Arial;
> Does 'inherit' set font-style, or font-variant, or font-weight? They are
> allowed in any order, and they are all optional, so which one is it?
>
> You case is different, since the 'inherit' value appears in a position where
> it must mean a value for font-family. But the above notes show how confused
> even the W3C is with 'inherit'.[/color]
The W3C example is somehow nondeterministic, yes, but as you say my
example is different. And I think it should be clear, that's why I'm
surprised about the browsers behaviour.
[color=blue][color=green]
>>And HTML like this:
>><p>Bla bla <strong>important thing</strong> and so on.</p>[/color]
>
> But why would you set the font-family at all? In theory, the initial value
> of this property "depends on user agent", but to be reasonable we must
> expect that browsers have a default style sheet that sets properties like
> font-family to 'inherit' to most elements, or act as if they did. Anyway, to[/color]
Yes, but the font-shorthand *must* contain a font-family-value if you
use it. And when I want to change two values out of three I think it's
economic to use the shorthand with two changed values and one "inherit".
I prefer that over writing font-size:... and font-weight:... .
[color=blue]
> stay on the safe side, you could dispense with the font shorthand and
> set directly[/color]
I'll probably have to while browsers (and W3C) remain unsure about it :/
[color=blue]
> p, strong { font-family: Verdana; }
> p { font-size: 10pt;
> strong { font-size: 14pt;
> font-weight: normal; }
>
> (if you have some odd reason for using Verdana and pt sizes).[/color]
No :)
But I think you missed one brace:
[color=blue]
> p { font-size: 10pt; }[/color]
-----------------------^
[color=blue][color=green]
>>Why are the CSS definitions for strong not applied at all?? At least in[/color]
>
> Do you mean that it uses, for the <strong> element in your example, some
> font other than Verdana? That would be odd, unless there's some other style
> sheet intervening.[/color]
No, it uses the default for <strong> of the user-agent: bold and same
font-size. Not bigger and unbold as I wanted it to be. It just seems
not to be applied.
Thank you for your quick reply, although it's not really satisfying
concerning the browser-misunderstanding issue.
Fabian