I've found this cool example of border-color
's transparent
property usage to make an arrow.
I understand how borders are drawn and how an empty element with one side set border can help achieve arrow effect, but what makes me wander in this example is usage of transparent.
Take a look at this simple code:
<div id="daniel"></div>
CSS:
#daniel{
border-color: rgba(111,111,111,0.2) transparent transparent;
border-style: solid;
border-width: 15px;
position: absolute;
}
With this code I get an arrow pointing down. (JSFIDDLE)
With only one transparent I get an hourglass
effect. (JSFIDDLE):
border-color: rgba(111,111,111,0.2) transparent;
What confuses me is not knowing what border-{side}
transparent
refers to in this shorthand properties.
Hope that makes sense.
Any help appreciated.
Thanks ;)