将<span>放在<td>表格单元格的底部

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)

它在Firefox中看起来如何

Dan*_*niP 7

你需要position:absoluteposition: 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)