Add triangle before submenu using css

前端 未结 3 1516
忘掉有多难
忘掉有多难 2020-12-30 18:02

How can i add triangle to the following example Fiddle

I need to remove the parent menu with white background and show triangle to to make it look more like this<

相关标签:
3条回答
  • 2020-12-30 18:15

    You need to apply a class to the list items that have dropdown divs and then you can apply the pseudo element to that.

    Codepen Example

    0 讨论(0)
  • 2020-12-30 18:23

    I have tried something by adding extra .arrow_div ans apply css to it, check menuone you will see black arrow, may be this you looking for, better suggestion have a background image which have arrow and set it as you menudiv background

    SAMPLE DEMO

    0 讨论(0)
  • 2020-12-30 18:27

    Hope this helps, I have commented out some of your css and jquery scripts. Also, added a style at the end please kindly refer this link fiddle

    The css I added follows,

    .dropdown ul li:first-child > a:after {
     content: '';
     position: absolute;
     left: 30px;
     top: -8px;
     width: 0;
     height: 0;
     border-left: 5px solid transparent;
     border-right: 5px solid transparent;
     border-bottom: 8px solid #028F41;
     }
    
    0 讨论(0)
提交回复
热议问题