问题描述
我有一个链接,我想永远在它所在的单元格的右下角。现在链接是在< p>元素。我试着做绝对的和相对的定位,但我可以得到我想要的效果。
I have a link that I want to always be at the bottom right of the cell it is in. Right now the link is in a < p > element. I tried doing both absolutely and relative positioning but I can get the effect I am looking for.
我有一行有4个单元格,当试图应用绝对位置将元素移动到右边的最后一个单元格...而不是将它放置在它所在的单元格内。我尝试了各种方法,但不确定我是否确定疲劳或试图做不可能的。
I have a row with 4 cells, when attempting to apply the absolute position it takes the element to the very last cell on the right... instead of just placing it within the cell it is in. I tried various methods but not sure if I am sure tired or trying to do the impossible.
我对css表非常新,所以我可以考虑这个错误。
I am very new to css tables so I could be thinking about this all wrong.
这里是一个例子:
- http://jsfiddle.net/56H5x/1/
右侧的了解详情链接应该位于第一个单元格。
The "Learn more" link to the very right should be at the bottom right of the first cell.
提前感谢。
推荐答案
扩展Ahsan Rathod的解决方案解决这个问题在firefox包装你的内容在一个div和设置您的属性在这个div,比div设置为display table-cell
Expanding on Ahsan Rathod's answer to solve this issue in firefox wrap your content inside a div and set your properties on this div rather than the div set as display table-cell
.cell-div {display:table-cell}
.relative-div {position:relative; width:100%}
.absolute-el {position:absolute}
<div class="cell-div">
<div class="relative-div">
<div class="absolute-el">
<img ... >
</div>
</div>
</div>
这篇关于你可以相对地或绝对地在显示器中定位项目:table-cell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!