gpt4 book ai didi

html - 带有显示 : table-cell 的元素内绝对位置的 Firefox 问题

转载 作者:行者123 更新时间:2023-11-28 04:13:11 25 4
gpt4 key购买 nike

我有 3 个里,我试图水平排列,然后在每个里放置一个跨度。

跨度在 Chrome 中正确定位,但在 Firefox 中远远超出了 li 的边界。

http://jsfiddle.net/brendan_rice/mPnCh/1/

有人可以帮忙吗?

<div id="blank-slate-steps">
<ul>
<li class="first">
<h3><em>Step 1</em>Create Something</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
<li class="second">
<h3><em>Step 2</em>Create Something Else</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
<li class="third">
<h3><em>Step 3</em>Create Final Thing</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
</ul>
</div>​

CSS

body{
padding-top: 300px;
}
#blank-slate-steps {
background-color: #E8E8E8;
bottom: 0;
font-family: OpenSansCondensedBold,sans-serif;
text-align: center;
width: 100%;
}
#blank-slate-steps li {
display: table-cell;
max-width: 300px;
padding: 40px;
position: relative;
width: 300px;
}
#blank-slate-steps h3 {
font-size: 1.6em;
margin-bottom: 0.6em;
}
#blank-slate-steps h3 em {
color: #878787;
float: left;
font-size: 0.8em;
font-style: normal;
margin-bottom: 4px;
text-transform: uppercase;
width: 100%;
}
#blank-slate-steps li.second span {
background: red url("../images/sprite/icons-grey-38.png") no-repeat scroll 0 -56px transparent;
height: 37px;
width: 36px;
}
#blank-slate-steps span {
background-color: red;
display: block;
height: 20px;
left: -10px;
position: absolute;
top: 50px;
width: 20px;
}

最佳答案

对 blank-slate-steps div 使用相对位置。

#blank-slate-steps {
background-color: #E8E8E8;
bottom: 0;
font-family: OpenSansCondensedBold,sans-serif;
text-align: center;
width: 100%;
position: relative;
}

关于html - 带有显示 : table-cell 的元素内绝对位置的 Firefox 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13200399/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com