crm*_*cco 1 html css html-table css-position
我试图让一个<span>
坐在固定高度的底部<td>
,但它似乎没有工作.
我正在使用Firebug在Firefox中开发,这是我的标记和CSS.
我已经阅读了其他帖子,说明td
高度需要修复,我已经做到了,但是我仍然遇到同样的问题.如何将跨度定位在td的底部?
<td class="details_amount">
<span class="item_total_price">
£<span id="amount_99201100099">49</span>
</span>
<br>
<span class="person_price">£5</span>
</td>
td {
height: 55px;
padding-top: 1.8em;
vertical-align: top;
}
.item_total_price {
height: 100%;
}
.person_price {
bottom: 0;
position: relative;
}
Run Code Online (Sandbox Code Playgroud)
你需要position:absolute
不position: relative
为.person_price
:
.person_price {
position: absolute;
bottom:0;
left:0;
}
Run Code Online (Sandbox Code Playgroud)
并且还让他的父母relative
:
td {
position:relative;
}
Run Code Online (Sandbox Code Playgroud)