- From: Ian Hickson <py8ieh@bath.ac.uk>
- Date: Sat, 22 Jan 2000 02:49:53 +0000 (GMT)
- To: Matthew Brealey <thelawnet@yahoo.com>
- cc: www-style <www-style@w3.org>
On Fri, 21 Jan 2000, Matthew Brealey wrote: >>>>> Another reason that this approach is better is that it >>>>> associates backgrounds with the line box rather than the text. >>>> This of course means that text can _easily_ flow outside the >>>> background, which is bad. >>> Not at all. Give me an example of how this could happen. >> Give your line boxes a short line-height (however you do that in >> your proposal) and your inlines a larger font. > This would occur under the existing specification - P {line-height: > .8} would result in at least the top of the text, and probably the > bottom (depending on your 'interpretation' (for which read 'change') > of the spec [) not having the background]. (I added the last bit because you seemed to have missed it. If that is not what you meant (I'm not sure) then disregard the next comment and tell us what you really meant.) No! That would *not* cause the background to not appear under the text -- the background has NO RELATION to the line-height WHATSOEVER! It goes around the font box. See Eric's document for more exact details: http://www.meyerweb.com/eric/css/inline-format.html ...where he says: # font-size = the value used with the em-box to scale the font for display # # content-area = in non-replaced elements, the box described by the # font-size of each character in the element, strung together; in # replaced elements, the intrinsic height of the element plus any # margins, borders, or padding # # ... # # * the background of an inline element is applied to the content-area # plus any padding Note that that document is exactly what the spec says, just in clearer language. No special interpretation required. And David's document agrees with this -- no change there either. http://www.fas.harvard.edu/~dbaron/css/2000/01/dibm > There is no difference whatsoever, except that it my suggestion, > 10px would be backgrounded, whereas if you try and imply some > anonymous spanning concept into the spec it would be 13 - Bp + > Banonymous. In neither case would it fully cover the text (unless > the text was greatly smaller than its nominal font-size) value; and > neither should it - if line-height<font-size, this surely can only > be right. Feh? I believe you have misunderstood the spec here... See my explanation above. >> However, I've just realised an even worse problem with putting the >> background on the line box rather than the inline boxes. It makes >> it impossible to have a transparent part if the lines are far >> apart: > And how would that occur - line boxes are stacked without > separation? In the CSS1 model, you can get the effect I describe using: block { line-height: 2; } span { background: something; } Again, see the documents above for more exact details. >>>>> means that one cannot follow the advice in the spec that states >>>>> that one should always set background colours when one sets >>>>> foreground colours dangerous on inline elements. >>>> Why? If one does not do as the spec suggests, then one is asking >>>> for conflicts, meaning that text will be unreadable (e.g., black >>>> on black). >>> This is highly unlikely. You could probably search night and day >>> for a thousand years and not find someone who sets backgrounds on >>> inline elements. > I missed the word 'user' out there. They must not do so, since it > would clash with old HTML documents where alink, vlink and link can > be specified but not alinkbgcolor, etc. /me looks puzzled. See my recent post about user stylesheets. What you describe need not happen with well written and responsible user stylesheets. >>> The reason that it is dangerous is that (particularly on A, which >>> is very commonly set to a different colour) if you set a >>> background on an inline element within a line box of different >>> colour, the things don't get lined up and the result looks stupid. >> Please explain why it would look stupid. > Because it isn't aesthetically pleasing. I don't see why. Could you provide an example? (Preferably with a PNG screenshot of what you think should happen and how it is ugly.) -- Ian Hickson ("`-''-/").___..--''"`-._ http://www.bath.ac.uk/%7Epy8ieh/ `6_ 6 ) `-. ( ).`-.__.`) (_Y_.)' ._ ) `._ `. ``-..-' fL Member, Mozilla Quality Assurance _..`--'_..-_/ /--'_.' ,' Browser Standards Compliance Team (il).-'' (li).' ((!.-'
Received on Friday, 21 January 2000 21:49:58 UTC