Creating a triangle using CSS is pretty easy and common practice, but is it possible to create a triangle in a similar way with a transparent background and just a border.
This is what I would like to create:
Given the way triangles are typically made, I dont really know where to start as they rely on pseudo elements and overlapping borders etc. This obviously cannot be done if the border is transparent...
Does anyone have any ideas of how to do this? Is it even possible?
Arrows. To create a simple arrow without a tail, make a box with a width and height, border, as well as zero left and top borders. To make an up arrow, add the transform: rotate(225deg); property, and to make a down arrow, add the transform: rotate(45deg); property to rotate the arrow to 225 and 45 degrees respectively ...
Use 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>
You can use a pseudo-element to insert a character from this list:
⌵
(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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With