I just found a nice script you can see it over here
http://demo.tutorialzine.com/2012/10/css3-dropdown-menu/
I saw the drop down has a little ^ on top. On the css I could find this:
#colorNav li ul li:first-child:before{
content:none;
position:absolute;
width:1px;
height:1px;
border:5px solid transparent;
border-bottom-color:#313131;
left:50%;
top:-10px;
margin-left:-5px;
}
Only I can’t understand how this is working; does it have
something to do with the border?
This CSS operates on the following markup (reduced for simplicity):
The selector targets the
:beforepseudo-element on the inner-mostlielements that are also the first elements within their parent:Missing from your code here, but present in the original tutorial, was the following comment:
This particular set of rules is for creating the small triangle that appears at the top of the dropdown menus, pointing up to their associated block (pictured below, emphasized with a red circle):
The styles then follow for creating this triangular shape:
The end-result, is a triangle created purely with borders in CSS.