Aligning
  • next to each other, not working
  • 前端 未结 4 861
    眼角桃花
    眼角桃花 2021-01-04 22:01

    I have a problem with aligment of two li elements inside a div because in the next example

    HTML

    4条回答
    •  栀梦
      栀梦 (楼主)
      2021-01-04 22:09

      This is purely to do with the fact that your width specification is more than you've allowed for the child element in relation to it's parent elements:

      .menu-left ul li {
          display:inline-block;
          vertical-align: top;
          width: 50%; // should be less than 50%
      }
      

      Updated fiddle: http://jsfiddle.net/KhLhR/3/

    提交回复
    热议问题