Extra line break between ordered list items

只谈情不闲聊 提交于 2020-04-30 14:05:52

问题


Question. Is it possible to add an extra line break between list items. par exemple

My current situation. I'm using Rails with bootstrap.

  <h1> Things I like </h1>
  <ol>
    <li> Apples </li><br>
    <li> Bananas </li><br>
  </ol>

I want that extra line break between my list items but I don't want to have to do the br tag between each. Is it possible through CSS or some special bootstrap class to take care of that?


回答1:


In your CSS file:

li {
    margin-bottom: 10px;
}

You can modify the accessor ("li") or the value as you need.




回答2:


li {
    margin: 0 0 20px 0;
}

for top, right, bottom, left

or

li{
    margin: 10px 0;
}

for top&bottom, left&right

or just

li {
   margin-bottom: 20px;
}


来源:https://stackoverflow.com/questions/56138596/extra-line-break-between-ordered-list-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!