使用 transform
:
div {
border: 1px solid #000;
border-width: 0 0 2px 2px;
width: 10px;
height: 10px;
line-height: 0;
font-size: 0;
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
div:first-child {
margin-bottom: 25px;
-webkit-transform: rotate(135deg);
-ms-transform: rotate(135deg);
-o-transform: rotate(135deg);
transform: rotate(135deg);
}
<div></div>
<div></div>
:)
- Praveen Kumar Purushothaman您可以使用伪元素来插入此列表中的字符:
⌵
(U+2335)V
(U+0056)v
(U+0076)
(U+1d5b5)
(U+1d5cf)⋁
(U+22c1)Ⅴ
(U+2164)ⅴ
(U+2174)div {
display: inline-block;
background: #000;
color: #fff;
text-transform: uppercase;
font-family: sans-serif;
font-size: 150%;
padding: .75em;
}
div:after {
content: '⌵';
display: block;
text-align: center;
font-size: 125%;
}
<div>Scroll down</div>
⌵
符号,但在Chrome中也看起来不错。 - Oriol.blk {
width: 150px;
height: 60px;
background-color: black;
}
.blk .fa {
color: white;
margin: 40px 50% auto 50%;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<div class="blk">
<i class="fa fa-chevron-down"></i>
</div>
.class:before {
content: "";
width: 15px;
height: 3px;
background-color: black;
display: inline-block;
transform: rotate(45deg);
}
.class:after {
content: "";
width: 15px;
height: 3px;
background-color: black;
display: inline-block;
transform: rotate(-45deg);
margin-left: -7px;
}
<a href="#" class="class"></a>
body{background:#000;color:#fff;font: 16px/1 sans-serif;}
h2{text-align:center;}
.arrowDown{
position:relative;
}
.arrowDown:after{
content: "";
position:absolute;
left: 50%;
bottom: -16px;
width: 16px;
height: 16px;
margin-left: -8px; /* (16/2) */
border-right: 3px solid #fff;
border-bottom: 3px solid #fff;
transform: rotate(45deg);
}
<h2 class="arrowDown">Scroll down</h2>
另一种选择是使用SVG来创建形状。
.scroll_down {
box-sizing: border-box;
width: 150px;
height: 90px;
background: black;
padding: 5px;
text-align: center;
}
.scroll_down p {
font-family: sans-serif;
color: white;
}
<div class="scroll_down">
<p>Scroll Down</p>
<svg width="20px" height="10px" viewBox="0 0 20 10">
<path fill="none" stroke-width="2" stroke="white" d="M1,1 L10,9 L19,1"></path>
</svg>
</div>
它得到了很好的支持,并且相对容易使用。