第一个是我想要更改的代码。
<style>
h1::after {
content: url(sig01.png);
}
</style>
第二是我尝试过,但没有成功。
<style>
h1::after {
content: url(sig01.png);
display: inline-block;
width: 200px;
height: 200px;
}
</style>
我做错了什么?
您不能调整内容图像的大小,但可以使用background-image
而不是content
。
<style>
h1::after {
content: '';
display: inline-block;
width: 200px;
height: 200px;
background-image: url(sig01.png);
background-size: 200px;
}
</style>