304 users online (0 members and 304 guests)  

  Results 1 to 1 of 1


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

    Join Date
    Jan 2008

    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:
    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!!
    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