I'm trying to put an arrow-up by using "pure" CSS on my active items menu. Problem, I have a weird output. here my FIDDLE. Do you know how to resolve it ?

    #cssmenu li.active a {
   /* display: inline;
    border-bottom: 3px solid #00b8fd;
    float: left;
    margin: 0;*/
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;

    border-bottom: 10px solid black;
}
有帮助吗?

解决方案

The issue here is that the arrow is going to be as wide as the li that it describes. The best way to do something like this is to use a css pseudo element. What you are looking at is something like:

#cssmenu li.active a:before {
    content: ' ';
    width: 0px; 
    height: 10px; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid black;
    display: inline-block;
}

Best of luck!

Updated Fiddle: http://jsfiddle.net/XLfcY/

其他提示

div{
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid black;
}

for the pure css arrow

The arrow at the bottom as you asked

position: relative;
top: 60px;

here the fiddle link http://jsfiddle.net/suriyag/HwcTn/1/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top