I must admit, I was pleased to see that first question, about line height. I, too, learned to use unitless line height a long time ago, and I was surprised to discover that its behaviour is not widely known. A couple of years ago, I had somebody on these forums ranting at me for my utter stupidity in not redeclaring my line height after I changed font size, and my explanation was met with disbelief.
(It’s probably just as well he’s no longer around; I can have a quiet gloat without being tempted to remind him in person. )
Yay, I got 96%, quite happy with that, but I have no clue where I tripped up. None whatsoever.
Incidentally the JavaScript Core test on the same site has far too many browser DOM centric questions to be branded JavaScript Core. They should probably be two separate tests.
Heh, it wasn’t that he didn’t know about unitless line heights, but rather that he passionately disagreed with their use. Still, I wasn’t convinced, and am quite a fan of them.
Any ambiguous wording in questions or options that, intended or not, fools the answerer is not testing css knowledge imho. The ambiguity/difficulty should be put in the problem itself.
I’ll take the tests then, though I’m prone to error a lot when distracted.
Maybe 100% could be made by my ignorant mistakes. How would I know?
Not using unitless line-heights means you are signing on to specify a line-height whenever you specify a font-size. It’s doable, but hardly a sensible default position, I’d say.
Would you need to change anything if that line height were set in ems or % though? Whatever you changed the font size to would be automatically reflected in the line height, wouldn’t it? (Granted, though, that it’s a different story for descendent elements, as the Eric Meyer link above shows, so I still don’t like the idea of setting units on line height.)
Anyhow, here’s one of the discussions by said member about line height: Layout Disaster! (CSS) - #36 by system, in case anyone’s interested in what we are referring to!
This would cause every element in your document to calculate its own line height based on its own font size. But you can get the same effect with just
html { line-height: 1.2; }
and that only requires the browser to match one element, rather than every single element on the page.
To be clear, this:
html { line-height: 1.2em; }
will not calculate auto-adjust the line height for each element’s font-size. It calculates a fixed line height (1.2 times the html element’s font-size) and every element in the document inherits that fixed height, regardless of its own font-size.
Really liked the quiz but made a poor result above and had to wait one week to get a second shot at it.
The trickyness in some questions made me I feel like I knew the proper answer but had a hard time decide what was really the question. Guess I was luckier this time.