W3C home > Mailing lists > Public > www-html@w3.org > August 2004

Re: Navigation List Issues

From: Trejkaz Xaoza <trejkaz@xaoza.net>
Date: Mon, 2 Aug 2004 00:28:26 +1000
To: www-html@w3.org
Message-Id: <200408020028.26160.trejkaz@xaoza.net>

On Sun, 1 Aug 2004 23:17, Lachlan Hunt wrote:
> Trejkaz Xaoza wrote:
> > But <nl> also contains <label>.  There is no container for just the
> > items, as the original poster pointed out.
> So what? a seperate container is not necessary.
> >>>If I wanted to
> >>>apply a style to the list items, would I have to address each one
> >>>individually? What if I wanted a simple outset border around just the
> >>>list items of a navigation list?
> >>
> >>  nl li[href] { border: 2px outset black; }
> >
> > The original poster wanted a border around the list items, not one border
> > around _each_ list item.
> Ok, that's easy.  I created an XHTML2 document and applied this css and
> achieved the desired effect.  I'm sure there are plenty of other way's
> to do it, this is just one.
> nl { display: block; border: 2px outset black; }
> nl label { margin-top: -1em; }
> li { display: list-item; }

This doesn't work on Firefox, but you might be using another browser anyway.

Also, how would this work?  As far as I can tell, this would move the label up 
one line above the box.  What if that causes spacing issues with whatever was 
before the list?  What if the label contains more than one line of text?

The only way I think this would be easy to hack together would be something 

nl li { border-left: 1px solid black; border-right: 1px solid black; }
nl li:first-child { border-top: 1px solid black; }
nl li:last-child { border-bottom: 1px solid black; }/* Is last-child valid? */

So it can be done, sure, but it's not exactly clean in any sense of the word.


'Every sufficiently advanced technology is indistinguishable from magic' - 
Arthur C Clarke
'Every sufficiently advanced magic is indistinguishable from technology' - Tom 

             Email: Trejkaz Xaoza <trejkaz@xaoza.net>
          Web site: http://xaoza.net/trejkaz/
         Jabber ID: trejkaz@jabber.xaoza.net
   GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F  A62C B8C7 BC8B 037E EA73
Received on Sunday, 1 August 2004 10:28:34 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 30 April 2020 16:20:54 UTC