Twitter Bootstrap sideways caret

前端 未结 9 583
执念已碎
执念已碎 2021-01-31 03:09

I\'m using Twitter Bootstrap and some custom css (found here) to have dropdown menus open up on mouseover.

I am using the \"caret\" on a on the root menu items to show

9条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 03:33

    I use these styles to do that (it works without bootstrap as well)

    HTML:

    
    
    
    
    

    CSS:

    .caret {
        border: 5px solid transparent;
        display: inline-block;
        width: 0;
        height: 0;
        opacity: 0.5;
        vertical-align: top;
    }
    .caret.up {
        border-bottom: 5px solid;
    }
    .caret.right {
        border-left: 5px solid;
    }
    .caret.down {
        border-top: 5px solid;
    }
    .caret.left {
        border-right: 5px solid;
    }
    

提交回复
热议问题