我需要重构这个任务 How to add triangle in table cell
我不需要背景 div。
<td>
<div style="position: relative;right: 0;top:0;">@Html.ImageContent("triangle_bonus.png", "")</div>
//@Html.DropDownListExtention
</td>
最佳答案
尝试:
<td style="position: relative;">
<div style="position: absolute;right: 0;top:0;">@Html.ImageContent("triangle_bonus.png", "")</div>
</td>
如何将您的 html 更改为:
<td class="triangle">
<div>@Html.ImageContent("triangle_bonus.png", "")</div>
</td>
并将此添加到您的头部 html:
<style>
td.triangle {position:relative}
td.triangle div {position:absolute; right:0; top:0;}
</style>
看这个例子: http://jsfiddle.net/Juvcx/
关于html - 如何在td的右上角添加div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14502436/