Afficher un message
Vieux 02/03/2008, 09h09   #2
Ben C
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Inline box model question

On 2008-03-02, GTalbot <newsgroup@gtalbot.org> wrote:
> Hello fellow stylesheet colleagues,
>
> I'd like to be sure about my understanding of the inline box model.
>
> Question: In this webpage,
> http://www.gtalbot.org/BrowserBugsSe...eElements.html
> I submit that inline box height should not grow, should not stretch
> vertically to fit nested inline child elements.


That's correct.

> Am I wrong? I can't
> seem to find the exact spot where CSS 2.1 says so.


I think you have found it-- 10.6.1, right the beginning. The height of
an inline box's content area is based on the font. Nothing is mentioned
about inline descendents. Therefore they are not involved.

You will find a slight anomaly in Firefox with outline on inline boxes--
I suspect it's because because outline is sometimes used to indicate the
focussed element and when there are imgs in links most people prefer
the outline to go around the img not strictly around the <a>'s inline
box.

> Same issue, same question with
> http://www.gtalbot.org/BrowserBugsSe...I-padding.html
> and
> http://www.gtalbot.org/BrowserBugsSe...LI-margin.html
>
> I think CSS 2.1, section 10.6.1
> applies, in particular
> "The vertical padding, border and margin of an inline, non-replaced
> box start at the top and bottom of the content area, not the 'line-
> height'. But only the 'line-height' is used when calculating the
> height of the line box."
> http://www.w3.org/TR/CSS21/visudet.h...e-non-replaced


Yes, exactly. In the two examples above you haven't set line-height,
but you're demonstrating the same issue that padding on descendent
inlines isn't involved in inline box height calculation.
  Réponse avec citation
 
Page generated in 0,05874 seconds with 9 queries