css - Firefox :before position absolute incorrect -


this question has answer here:

[duplicate of firefox support position: relative on table elements?]

i have unordered list vertical rules between list-items:

html

<ul class="list-inner-border">     <li><span></span></li>     <li><span></span></li>     <li><span></span></li> </ul> 

css

.list-inner-border {     height: 100px; }  .list-inner-border li {     display: table-cell;     position: relative; // not having causes misbehaviour     width: 1%; } .list-inner-border li + li:before {     background-color: red;     content: '';     height: 80%;     left: 0;     margin-top: 5%;     position: absolute;     top: 0;     width: 1px; }  span {     background-color: gray;     display: block;     height:90px;     margin: 5px; } 

fiddle

the above works in browsers except firefox, behaves if container of position:absolute not have positioning of own (common oversight position:absolute):

chrome:

list inner border working in chrome

firefox:

list inner border not working in firefox

in firefox, :befores have jumped outside container , stacked vertically along edge of root element.

elements position: absolute; meant refer next parent position:absolute;. jacob proved me wrong here.

if assign 0 left or top, align root element. leave away , rules' positions correct in firefox.

because percentage based values differently calculated, might need absolute values there. make fallback firefox: targeting firefox css

sorry haven't found better


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -