在一些文字后添加行

时间:2016-01-09 04:52:33

标签: css

我试图在一些文字之后找一条线。

.dash span {
 background-color: white;
 padding-right: 5px;
 }

.dash:after {
 content: "";
 position: absolute;
 bottom: 0;
 left: 0;
 right: 0;
 height: 0.5em;
 border-top: 1px solid #000;
 z-index: -1;
}

http://jsfiddle.net/pkm5r/62/

1 个答案:

答案 0 :(得分:1)

只需从。height: 0.5em;中删除dash::after即可。

.dash:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid #000;
  z-index: -1;
}

<强> Updated Fiddle