43 users online (0 members and 43 guests)  


  Results 1 to 1 of 1

Related

  1. Child Selectors    Forum: CSS Forum
    Replies: 0
  1. #1
    futureproof's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2008
    Location
    Canberra
    Posts
    10

    Adjacent selectors in IE7

    I saw this tip at Webcredible:
    The adjacent selector is another extremely useful CSS selector that up until now Internet Explorer hasn't understood. Fortunately, IE7 does understand it. The adjacent selector basically allows you to reference an HTML element that's adjacent to another element:
    Code:
    blockquote+p {margin-top: 0;}"
    The above CSS code basically says that any paragraph that's preceded by a quote shouldn't have a top margin. The author states that this is useful if you always wish to cite the person making the quote in a paragraph after the quote and may want to get rid of the space between the paragraph and quote.

    However, it does not seem to work!

    This code, on the other hand, does work!!
    Code:
    p+blockquote {margin-top: 0;}
    providing for no margin above the blockquote.

    I have tried other methods, such as p and body, body and p, using this tip but to no avail ... comments welcome; you can play with the CSS and see if it works for you.
    Attached Files Attached Files



Tags for this Thread