CSS/Webkit: Background Images for Table Row

后端 未结 3 1123
Happy的楠姐
Happy的楠姐 2020-12-31 20:38

For some reason when you apply a background image to a tr in Safari/Chrome it renders it as if the rule applies to every td.

Firefox:


(source: whyp

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 20:46

    By default, the TR and TD have display properties table-cell and table-row. We need them to forget about it and feel like simple block elements:

    tr {display: block;}
    td {display: inline-block; background: transparent;}
    

    This code solved the problem of rendering for me.

提交回复
热议问题