Re: Inline h*ll

On Thu, 13 Jan 2000, Matthew Brealey wrote:
 
> I've just realised what the problem is. I see what you mean - the
> difference is in our respective interpretations of <br>. We were
> both working on the same basis - the only difference is with <br>,
> but I was going on the basis of: [snip CSS1]

Consider CSS1 to be superseded. CSS2 changes quite a few minor things
like this, so it is best to use it as a reference.

> On the basis that CSS 2 doesn't say anything about BR

Nothing normative, at any rate. You can treat BR as an empty inline
element with this style:

   BR:before { 
      content: '\A';
      white-space: pre;
   }

> I was working on the basis that it wasn't considered for the purpose
> of line height calculations 

Section 10.8:

# Empty inline elements generate empty inline boxes, but these boxes
# still have margins, padding, borders and a line height, and thus
# influence these calculations just like elements with content.


> In particular, if this had occurred in the case in point; i.e., the
> break was natural rather than forced, the height of the element most
> certainly would be 54 px.

This is a slightly more controversial case. A strict interpretation of
CSS2 would indeed mean that the second line would be 54px high (and
the text would overlap surrounding lines _a lot_). However, previous
proposals from both David Baron and myself have suggested that to make
line-height work well for blocks, an anonymous inline should wrap all
blocks' contents. This would result in the same effect as with the
empty inline BR in the previous example, and is what both Opera 4 and
Mozilla 5 have implemented.

I believe the first time this was proposed is over a year ago:

   http://lists.w3.org/Archives/Public/www-style/1999Jan/0027.html

...but see also:

   http://lists.w3.org/Archives/Public/www-style/1999Aug/0109.html

Note that this also solves some problems with vertical-align: top and
vertical-align: bottom that present in the current spec.

BTW: Thanks for changing your wrapping settings. :-)
-- 
Ian Hickson                            ("`-''-/").___..--''"`-._   
http://www.bath.ac.uk/%7Epy8ieh/        `6_ 6  )   `-.  (     ).`-.__.`)
                                        (_Y_.)'  ._   )  `._ `. ``-..-' fL
Member, Mozilla Quality Assurance     _..`--'_..-_/  /--'_.' ,'
Browser Standards Compliance Team    (il).-''  (li).'  ((!.-'    

Received on Thursday, 13 January 2000 11:47:23 UTC