4

I need refact this task How to add triangle in table cell

I need not background a div.

    <td>
     <div style="position: relative;right: 0;top:0;">@Html.ImageContent("triangle_bonus.png", "")</div>
//@Html.DropDownListExtention
    </td>

enter image description here

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mediator
  • 14,951
  • 35
  • 113
  • 191

1 Answers1

9

Try:

<td style="position: relative;">
<div style="position: absolute;right: 0;top:0;">@Html.ImageContent("triangle_bonus.png", "")</div>
</td>

How about changing your html to:

<td class="triangle">
<div>@Html.ImageContent("triangle_bonus.png", "")</div>
</td>

And adding this to the head of you html:

<style>
td.triangle {position:relative}
td.triangle div {position:absolute; right:0; top:0;}
</style>

Look at this for example: http://jsfiddle.net/Juvcx/

Ryan King
  • 3,538
  • 12
  • 48
  • 72