SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    India
    Posts
    73
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Confusion in CSS Selectors

    hello all,

    i want to learn how to write nested CSS selectors like

    Code:
    #menu>ul>li:hover>a span
    any link with the example will be most helpful.

    thankyou

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    Tinker Air Force Base, Oklahoma, United States
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,372
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You can read about combinators in the Sitepoint reference or more specifically here.

    If the question is about the child selector of which the combinator is the > sign then that simply matches all elements that are the immediate children of a specified element whereas a descendant selector matches all children.

    The child selector is useful in dropdown menus because you limit the scope to the immediate children and not interfere with any nested submenus of which their could be many.


Bookmarks

Posting Permissions

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