#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    288
    Rep Power
    12

    Simple CSS selectors question.


    Ok I have these CSS classes which I only want to be applied if the occur within an element already assigned a class i.e.

    <div class="toplevel">
    <div class="intop1">Stuff</div>
    <div class="intop2">Stuff</div>
    </div>

    Now how I expected it to be formated in my CSS is probably not right, here's how I put it at the moment:

    .toplevel { }

    .toplevel.intop1 {}

    .toplevel.intop2 {}

    But I discovered if I have something else with one of the intop classes which is not within an element with toplevel class it still takes the intop settings.

    Any help would be greatly appreciated.

    -D
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    65
    Rep Power
    13
    hi

    try this:

    .toplevel {}
    .toplevel .intop1 {}
    .toplevel .intop2 {}

    you didn't put a space between the selectors
    /delta
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    288
    Rep Power
    12
    That seems to make no difference to me here.

    -D

IMN logo majestic logo threadwatch logo seochat tools logo