我需要重构此任务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>
答案 0 :(得分:7)
尝试:
<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/