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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    81
    Thanks
    7
    Thanked 0 Times in 0 Posts

    What does +div and + div mean?

    I think this is targetting an old version of IE:
    Code:
    +div {
    }
    ..but what is this:
    Code:
    .class1 + div, .class2 + div {
    }
    Thanks for any help. I'm sure this is simple.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,462
    Thanks
    0
    Thanked 633 Times in 623 Posts
    E + F Matches any F element immediately preceded by a sibling element E.

    So the CSS you are asking about is targetting the div immediately following the end of an element that has class="class1" or class="class2"

    for example the div in the following code:

    <p class="class1">text</p><div>something</div>
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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