Post by Nick TheodorakisCan anyone please help to understand what it means CSS rule that
makes all text 1.5 times larger than the base font of the system and
colors the text red?
[...]
Probably. And it seems that even c.i.w.a.s. regulars fail in it. It's
probably not a useful assignment, though, but a clever student can learn
from poor teaching too.
Post by Nick TheodorakisWell, anyway... To apply these properties to all text in a given
element such as <p>,
Wait a second... the assignment said "all text".
Post by Nick Theodorakisp
{
font-size: 1.5em;
color: red;
background: white;
}
No, that's not a right answer.
Post by Nick TheodorakisNote: always specify a background color if you choose a foreground
color.
A good principle indeed, but was in the assignment? I would say that it was
implicit in the assignment that the rule should have the given effects and
only them.
It does not help to replace p with body. It would only set properties for
the body element. Browser style sheets could still set other properties for
other elements, and in fact, they usually do. Typically, elements like code
and pre have reduced font size by default.
It seems that the correct answer is that no single CSS rule suffices. You
would need two rules:
body { font-size: 150% !important; }
* { font-size: 100%; color: red !important; }
Of course, usual CSS caveats still apply. But the above appears to maximize
the odds of achieving the goal that was set. The goal was very absurd in any
normal authoring context, but that's beside the point.
--
Yucca, http://www.cs.tut.fi/~jkorpela/