テーブルセルの表示が与えられたdivで相対位置を使用すると、firefoxに問題が発生します。Firefoxは相対位置を無視するため、テーブルセル内の絶対位置の要素が正しく表示されません。私のサンプル ページはhttp://dev.aaronpitts.ch/lhc/で見ることができます。これは Webkit などで正常に動作するので、私が何を達成しようとしているのかがわかります。これを試しても解決しませんでした: http://wisercoder.com/firefox-displaytable-cell-and-absolute-positioning/
影響を受けるコードは次のとおりです。
<div class="css-table">
<article id="crystallization">
<a href="#"></a>
<h2><i class="fa fa-arrow-circle-o-right icon-margin-r"></i> Crystallisation</h2>
<div class="service-hover">
<p>1) A comprehensive approach , from conceptualization & development through to realization</p>
<p>2) ^^ for global/hospitality projects</p>
<p>3) Our full range of services provide unique knowledge on the management of hospitality professionals, securing sustainable returns for your investments</p>
</div>
</article>
<div class="cell-space"></div>
<article id="consulting">
<a href="#"></a>
<h2><i class="fa fa-arrow-circle-o-right icon-margin-r"></i> Consulting</h2>
<div class="service-hover">
<p>1) Extensive industry experience and knowledge, combined with the ability to listen</p>
<p>2) Our integrative product offering provides you with innovative solutions that meet your specific needs</p>
</div>
</article>
</div>
そしてCSS:
.css-table {
display: table;
width: 100%;
}
#management-consulting article {
background-size: cover;
background-position: center center;
position: relative;
}
#management-consulting article a {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 2000;
}
#management-consulting article:hover h2 {
opacity: 0;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
#management-consulting article h2 {
background: rgba(0, 0, 0, 0.7);
padding: 20px;
position: absolute;
color: #FFF;
font-weight: 200;
text-transform: none;
}
#crystallization {
width: 60%;
display: table-cell;
background-image: url(../img/crystallization.jpg);
height: 400px;
}
#crystallization h2 {
bottom: 30px;
right: 30px;
}
.cell-space {
width: 2%;
display: table-cell;
}
#consulting {
width: 35%;
background-image: url(../img/consulting.jpg);
display: table-cell;
}
#consulting h2 {
top: 30px;
left: 30px;
}
.service-hover {
opacity: 0;
background: rgba(0, 0, 0, 0.7);
padding: 30px;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
font-family: "ff-dagny-web-pro",sans-serif;
font-style: normal;
font-weight: 200;
font-size: 20px;
font-size: 1.25rem;
color: #FFF;
}
#management-consulting article:hover .service-hover {
opacity: 1;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}