treehouse : what would you like to learn today?
Web Design Web Development iOS Development

First-child in IE6

  • IE6 doesn't support first-child. I've previously used this method to get around that, but now I want to do this:


    #footer ul li:first-child a {
    border-left: none;
    }


    As far as I can tell, there's no way to use the expression method to do this. If I write this...

    #footer ul li {border-left: expression...}


    ...that will style the first <li> itself, not the <a> inside it. And if I write this...

    #footer ul li a {border-left: expression...}


    ...that will style the first <a> inside every <li>.

    What I need to do is style every <a> inside the first <li>. Any way to get this working in IE?
  • I'm not exactly sure what your problem is, but did think about using a CLASS?

    I often use menu's like: | Home | Links | Contact |
    It took me a long time to figure out how to place the vertical lines.
    I now use something like:

    CSS:
    div#nav UL LI A {border-right: 1px solid #0000FF}
    div#nav UL LI A.first {border-left: 1px solid #0000FF}

    HTML:
    <DIV ID=\"nav\">
    <UL>
    <LI><A CLASS=\"first\" HREF=\"#\">Home</A></LI>
    <LI><A HREF=\"#\">Links</A></LI>
    <LI><A HREF=\"#\">Contact</A></LI>
    </UL>
    </DIV>

    HTH.

    gr. Bert
  • Just found a nice article about this:
    http://www.pathf.com/blogs/2008/04/hacking-the-fir/

    Gr. Bert