The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Adjacent sibling query

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #36413

    Untitled Document

    Title of Page

    This is a sample paragraph with a
    . Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt
    ut laoreet dolore magna aliquam erat volutpat. Ut wisi
    enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
    nisl ut aliquip ex ea commodo consequat.

    • Apples

    • Bananas

    • Cherries

    The output of this is increased font size of last two list items , could anyone explain me how ? because according to me only 2nd list item should show increase in font size . This is mainly because I am targeting (li + li) , sibling of li which is li(2nd list element)


    Any list item that immediately follows another will have a font-size of 200%. As the third list item immediately follows the second, the style also applies to it.

    You may want to instead try something like this li:nth-child(2), or li:first-child + li.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.