Forums

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

Home Forums CSS [Solved] Block level elements inside lists

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #186125
    Harun
    Participant

    here is my pen:
    http://codepen.io/hrazith/pen/CehGr

    I am stumped by basic stuff.
    Why are the block level elements inside <li> hindering how i want the<li> to be displayed. I am basically looking to turn this vertical list to a horizontal one.

    #186127
    shaneisme
    Participant

    Block level elements will take up 100% of the width of its parent by default. The list will let block level elements fill up its parent too, all the way up until there’s a width declared on something.

    You would need to apply a width to the .legend ul li, or for specificity’s sake you can just give each li its own class (it’s faster during render that way too).

    #186131
    Harun
    Participant

    Thanks shaneisme.

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