Skip to content Skip to sidebar Skip to footer

Right Floated Element Disappears When Using Columns In Firefox

I am using an ol element with column-count and column-gap properties to display the list in 2 columns. Each list item has a span element floated right, which does not get displayed

Solution 1:

Downgraded Firefox back to version 55.0 and the problem was fixed. I reported the bug to mozilla here: https://bugzilla.mozilla.org/show_bug.cgi?id=1441048

Solution 2:

For me, it seems to be a bug. I can imagine at least two fixes:

Add a list item if you have an odd number of list items

This is a hacky workaround:

.list {
  column-count: 2;
  column-gap: 60px;
}

.list > li:last-child {
  visibility: hidden;
}

.close {
  float: right;
}
<olclass="list"><li>Test 1
    <spanclass="close">&times;</span></li><li>Test 2
    <spanclass="close">&times;</span></li><li>Test 3
    <spanclass="close">&times;</span></li><li>Test 4
    <spanclass="close">&times;</span></li><li>Test 5
    <spanclass="close">&times;</span></li><li></li></ol>

Use absolute positioning

I think, this is the better solution:

.list {
  column-count: 2;
  column-gap:60px;
}

.list > li {
  position:relative;
}

.close {
  position: absolute;
  right: 0;
}
<olclass="list"><li>Test 1
    <spanclass="close">&times;</span></li><li>Test 2
    <spanclass="close">&times;</span></li><li>Test 3
    <spanclass="close">&times;</span></li><li>Test 4
    <spanclass="close">&times;</span></li><li>Test 5
    <spanclass="close">&times;</span></li></ol>

Post a Comment for "Right Floated Element Disappears When Using Columns In Firefox"