利用css将◇变成三角箭头效果,实现京东头部类似效果
上代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.fl{
float: left;
margin:100px;
height: 30px;
line-height: 30px;
background-color: gold;
}
i,s{
text-decoration: none;
}
.dt{
padding: 0 20px;
position: relative;
}
.dt i{
font: 400 15px/15px "宋体";
position: absolute;
top: 13px;
right: 3px;
width: 15px;
height: 7px;
overflow: hidden;
}
.dt s{
position: absolute;
top: -8px;
left: 0;
}
</style>
</head>
<body>
<div class="fl">
<div class="dt">
城市:杭州
<i><s>◇</s></i>
</div>
</div>
</body>
</html>
效果:
还有利用篇博客效果也不错,拿过来借鉴一下
纯 CSS 实现三角形尖角箭头的实例