Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Specific CSS?

  1. #1
    Regular Coder ajhauser's Avatar
    Join Date
    Nov 2007
    Location
    Earlville. It's where Earls come from.
    Posts
    226
    Thanks
    74
    Thanked 1 Time in 1 Post

    Specific CSS?

    Hello,
    I recently came across a stylesheet with the following line:

    Code:
    ul#nav > li > a:hover
    This got me wondering - what is the difference between that and this?

    Code:
    ul#nav li a:hover
    Any ideas?
    Thanks

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,726
    Thanks
    6
    Thanked 1,013 Times in 986 Posts
    The second rule will select anchors in list items on any level while the first selects only direct children.

    Code:
    <ul id="nav">
      <li>
        <a>link selected with rule 1 & 2</a>
        <ul>
          <li><a>link selected with rule 2 only, ignored by rule 1</a></li>
        </ul>
      <li>
    </ul>

  • Users who have thanked VIPStephan for this post:

    ajhauser (08-09-2012)

  • #3
    Regular Coder ajhauser's Avatar
    Join Date
    Nov 2007
    Location
    Earlville. It's where Earls come from.
    Posts
    226
    Thanks
    74
    Thanked 1 Time in 1 Post
    Got it - awesome! Thank you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •