搜索图标实现思路:
目的:一个元素实现搜索图标样式
1:使用当前元素 实现【一个圈】
2:给当前元素添加【伪元素】
2.1 给微元素添加边框属性、
2.2 给伪元素设置宽度和高度
2.3 使用位移:position 旋转 与【圆圈】重合
#示例代码
.icon {
display: inline-block;
}
.icon-search {
width: 0.4em;
height: 0.4em;
border: 0.1em solid black;
border-radius: 50%;
font-size: 10em;
position: relative;
}
.icon-search::before {
content: "";
width: 0.35em;
height: 0.08em;
border-width: 0;
background-color: black;
position: absolute;
left: -0.25em;
bottom: 0.1em;
transform: rotate(45deg);
}