How to overlay a simple div directly on top of a simple html table td?

后端 未结 1 1652
别那么骄傲
别那么骄傲 2021-01-15 13:19

I have a simple html table where each tr has a td for a label and a td for content. I\'m looking for the most correct / efficient way to draw a div over the top of the \"con

相关标签:
1条回答
  • 2021-01-15 13:36

    Why don't you insert a div into the content td and use position absolute. Like this: http://jsfiddle.net/8RuZe/

    td.content {
        position: relative;
    }
    div.over {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: red;
    }
    

    I've tested this method on all major browsers from IE8 to IE11.

    Good luck.

    0 讨论(0)
提交回复
热议问题