Reputation: 6254
I have big trouble with CSS positioning with absolute element inside display:table-cell
object. All browsers render correctly except Firefox.
My HTML looks like this:
<ul class="slider">
<li rel="sl1">
<span class="sltitle">Item 1</span>
<span class="pointer"></span>
</li>
<li rel="sl2">
<span class="sltitle">Item 2</span>
<span class="pointer"></span>
</li>
<li rel="sl3">
<span class="sltitle">Item 3</span>
<span class="pointer"></span>
</li>
</ul>
and CSS:
.slider {
list-style: none;
display: table;
width: 100%;
height: 100%;
position: relative;
}
.slider li {
display: table-cell;
border: 1px solid #1C1A1A;
position: relative;
overflow: hidden;
}
.slider li span.pointer {
display: block;
border: 1px solid red;
width: 100%;
height: 100%;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
z-index: 99;
}
Here is the JSFIDDLE for that: http://jsfiddle.net/zur4ik/SN7zL/
Please open this link in Chrome and then in Firefox, you'll see the difference. Do you know any proper way how to fix this issuer?
Upvotes: 0
Views: 1572
Reputation: 198
May be it's problem grow from this problem - Does Firefox support position: relative on table elements?
And - Positioning context on table-cell element in Firefox
Wrap the element with a div as position:relative.
.rel {
position:relative;
display:block;
height: 100%;
width:100%;
}
Upvotes: 1