.upper-menu .search-form::after {
content: url('../images/search.png');
position: absolute;
height: 10px;
top: 5px;
right: 22px;
}
我有一个伪元素,看起来像这样。我想通过缩小50%的比例来改变图像的大小,这样它也可以在高分辨率屏幕上工作。我该怎么做呢?
发布于 2014-12-04 00:27:53
此外,您还可以将内容设置为空字符串并使用背景图像。只是另一个选择..。
.upper-menu .search-form::after {
content: ' ';
display: inline-block;
position: absolute;
background: #bada55 url("img_2x.png") no-repeat;
background-size: contain;
height: 10px;
width: 10px;
top: 5px;
right: 22px;
}
发布于 2014-12-04 00:12:00
您只需将width和height属性设置为50%。这将根据浏览器窗口对其进行缩放。
祝好运!
https://stackoverflow.com/questions/27276399
复制相似问题