Previous Message
Next Message

How to specify the width of an element based on the width of his children?

Sent by Nicolae Daian on 18 March 2006 00:12


Hi,

Is there a way to specify the width of an element based on the width of his
children?
Giving the below example I would like that the BLUE border (the UL border)
to finishes exactly after the C0 RED border (the border of the last LI).

The following HTML:
<ul class="test">
  <li><a href="HTMLPage.htm">A0</a>
    <ul>
      <li><a href=" HTMLPage.htm">A1</a>
        <ul>
          <li><a href="HTMLPage.htm">A2</a></li>
          <li><a href="HTMLPage.htm">B2</a></li>
          <li><a href="HTMLPage.htm">C2</a></li>
        </ul>
      </li>
      <li><a href="HTMLPage.htm">B1</a></li>
      <li><a href=" HTMLPage.htm">C1</a></li>
    </ul>
  </li>
  <li><a href="HTMLPage.htm">B0</a></li>
  <li><a href="HTMLPage.htm">C0</a></li>
</ul>

And the following CSS:
ul.test
{
  border : solid blue;
  border-width: 4px 1px 4px 1px;
  height:2em;
}

ul.test li
{
  border : solid red;
  border-width: 1px 1px 1px 1px;
  float: left;
}
Will give the following picture: http://www.daser.ro/css/css.jpg

Thank you,
Nicu
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: