天天看點

表格中怎樣設定箭頭HTML,使用CSS在表格單元格内繪制一個箭頭

使用CSS形狀和僞元素:

HTML

Foo

CSS

* { margin: 0; padding: 0;}

td { border: 1px solid black; }

.comment:after {

content: "";

position: relative;

top: 0.5em;

border-left: 0.5em solid transparent;

border-top: 0.5em solid red;

}

修正包裝的更新答案:

td { border: 1px solid black; position: relative; }

.comment:after {

content: "";

position: absolute;

right: 0;

top: 0;

border-left: 0.5em solid transparent;

border-top: 0.5em solid red;

}

下一篇: nefu 18 滑雪