[Prev][Next][Index][Thread]

Issue 3: Backgrounds for Block vs. Inline Elements



E. Stephen Mack writes:

 > In considering whether the entire line of a paragraph should
 > be highlighted or just the actual text of the paragraph, I
 > looked at the following areas of the CSS1 specification for
 > relevant judgements:
 > 
 > * 5.3.2   background-color property [1]
 > * 5.3.7   background property [2]
 > * 5.5.2   margin-right property (initial value of 0) [3]
 > * 5.5.4   margin-left property (initial value of 0) [4]
 > * 5.5     Box properties [5]
 > * 5.5.25  float property (initial value of none) [6]
 > * 5.6.1   display property (initial value of block) [7]
 > * 4       Formatting model (margins are always transparent) [8]
 > * 4.1     Block-level elements [9]
 > * 4.12    Horizontal Formatting [10]
 > 
 > Given in [8] that margins are always transparent, and that the
 > initial values of the left and right margins are 0 [3] and [4],
 > and that the width of a paragraph must be "auto" -- but that
 > margin-left + paragraph width + margin-right must equal the
 > parent element's width [10], the best that I can determine
 > seems to be that the block-level elements should have a
 > full screen width background.

This is correct, but I wish there would be an easier way to reach the
conclusion. I believe the description of 'background-color' [1] could be
strengthened to more clearly say that the background color applies to
the rectangular box (or boxes) corresponding to the element. 

[1] http://www.w3.org/pub/WWW/TR/REC-CSS1#background-color

Thanks for your efforts,

-h&kon

H      k   o   n      W   i   u   m       L   i   e
howcome@w3.org   W o r l d   Wide  W e b  Consortium
inria # FRANCE http://www.w3.org/people/howcome


References: