I am trying to create an ordered list where each li
this list contains a Foundation 5.5.3 part.
The problem I am facing is that my li
elements insert some space at the top in front of its child network columns.
Example:
After some research, I found out that this is due to the CSS CSS rule, which places content: " "; display: table;
content: " "; display: table;
in the <... → psuedo element of my string.
However, overriding this, deleting it, places the interval in the line itself.
I tried to take the row
class from li
itself and insert the div.row
, but I still see the same problem.
To repeat, I would like to create a grid of 2 columns in each li
the ol/ul
list, but this adds some vertical space at the top of each li
. How can I get rid of this space, or is there another approach I have to take in order to get this grid with two columns within several li
s.
Thanks.
Example:
li { background-color: #ddd; padding: 5px; } li + li { margin-top: 5px !important; } li > span { background-color: yellow; } .row.psuedo-override::before, .row.psuedo-override::after { content: none !important; }
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.css" rel="stylesheet"/> <div class="row"> <div class="small-12 columns"> <h1>My List</h1> <h5><kbd>li</kbd> tags are <kbd>"row collapse"</kbd></h5> <ol> <li class="row collapse"> <span class="small-9 columns">Some long text goes here that should wrap to the next line if it is sufficiently long enough which this should qualify</span> <span class="small-3 columns text-right">$100</span> </li> <li class="row collapse"> <span class="small-9 columns">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nulla mauris, iaculis vel ante eget, vestibulum ornare est. </span> <span class="small-3 columns text-right">$50</span> </li> <li class="row collapse"> <span class="small-9 columns">Phasellus quis odio ac sapien congue aliquam sit amet ornare magna. Quisque consequat mauris nec turpis finibus, id bibendum dolor tincidunt.</span> <span class="small-3 columns text-right">$75</span> </li> </ol> </div> </div> <hr> <div class="row"> <div class="small-12 columns"> <h1>My List</h1> <h5><kbd>li</kbd> tags are <kbd>"row collapse"</kbd>, with no psuedo content. Vertical height gets messed up though...</h5> <ol> <li class="row collapse psuedo-override"> <span class="small-9 columns">Some long text goes here that should wrap to the next line if it is sufficiently long enough which this should qualify</span> <span class="small-3 columns text-right">$100</span> </li> <li class="row collapse psuedo-override"> <span class="small-9 columns">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nulla mauris, iaculis vel ante eget, vestibulum ornare est. </span> <span class="small-3 columns text-right">$50</span> </li> <li class="row collapse psuedo-override"> <span class="small-9 columns">Phasellus quis odio ac sapien congue aliquam sit amet ornare magna. Quisque consequat mauris nec turpis finibus, id bibendum dolor tincidunt.</span> <span class="small-3 columns text-right">$75</span> </li> </ol> </div> </div>
source share