CSS: Placing an arrow / triangle with border on the top of my drop down menu

后端 未结 2 2145
傲寒
傲寒 2021-02-07 10:05

Just launched this website (http://dovidoved.org/) and the client wants one of those triangles / arrows on the top of each drop down menu. Problem is the menu has a border aroun

2条回答
  •  梦毁少年i
    2021-02-07 10:32

    .main-navigation a:after {
        content: "";
        width: 0; 
        height: 0; 
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid #f00;
        position: absolute;
        top: -2px;
        right: -20px;
    }
    

    enter image description here

    Adjust the padding of li to make triangles fit.

提交回复
热议问题