Make link in table cell fill the entire row height

后端 未结 10 1020
清酒与你
清酒与你 2020-11-27 03:54

I have a table of data and each cell is a link. I want to allow the user to click anywhere in the table cell and have them follow the link. Sometimes the table cells are m

10条回答
  •  一整个雨季
    2020-11-27 04:44

    Set an arbitrarily large negative margin and equal padding on the block element and overflow hidden on the parent.

    td {
        overflow: hidden;
    }
    td a {
        display: block;
        margin: -10em;
        padding: 10em;
    }
    

    http://jsfiddle.net/RXHuE/213/

提交回复
热议问题