W3C home > Mailing lists > Public > www-style@w3.org > December 1997

Minizing the with of block elements.

From: Andrew n marshall <amarshal@usc.edu>
Date: Fri, 5 Dec 1997 16:15:24 -0800
Message-ID: <01BD0199.06439B80.amarshal@usc.edu>
To: "'www-style@w3.org'" <www-style@w3.org>

Space Cowboy's complaint about the NN4's rendering of his DIV box struck a 
familiar note to me.  I have had problems controlling underflow between the 
browsers as well. However, there was a major difference in that Cowboy's 
DIV box was absolutely positioned, my problem is with block layout.

Consider the following example:

<h1
STYLE="
border-color: #FF0000;
border-bottom-width: 3px;
border-bottom-style: solid;
">Hello
Again</h1>

According to CSS-2 [11.1.1], this is rendered as wide as the parent block 
and so the underline crosses the entire screen.  Needless to say, this is 
not what I always want. I might prefer to have the width minimized to the 
size of the text and there doesn't seem to be any way to do this.

One alternative for this would be defining 'auto' to be minimal instead of 
maximum.  This doesn't cause an backwards compatibility problems with CSS-1 
that I have noticed, since the sections on horizontal and vertical 
formatting [4.1.2, 4.1.3] seem to leave 'auto' relatively undefined as 
intrinsic width (to me, this actually implies minimum for textual 
elements). If this were the case, an author could adjust the 'min-width' or 
'min-height' to be as larger as desired. Often this will be "min-width: 
100%;", setting the width to the width of the parent.

Andrew n marshall
  student - artist - programmer
    http://www.media-electronica.com/anm-bin/anm
      "Everyone a mentor,  Everyone a pupil"
Received on Friday, 5 December 1997 19:10:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:53 GMT