伪后图像不起作用

时间:2017-07-04 14:39:25

标签: css

我尝试在我的标题下方获得相同的wave符号,如本网站http://harbr.co/所示,但它不起作用。到目前为止,我有以下CSS:

H2::after {
content: url ('images/wave.png');
position: absolute;
}

帮助?

2 个答案:

答案 0 :(得分:0)

url(之间有一个额外的空格。

H2::after {
  content: url('images/wave.png');
  position: absolute;
}

https://jsfiddle.net/qst68fLd/

答案 1 :(得分:0)



body { background-color: gray; }
h2:after {
content: "";
width: 42px;
height: 8px;
background: url('http://harbr.co/wp-content/themes/harbr2015/img/icons/divWave-sprite.png');
background-size: 100px 250px;
background-position: -50px -50px;
position: absolute;
top: 1em;
}

<h2></h2>
&#13;
&#13;
&#13;