Home:ALL Converter>Bootstrap scrollable dropdown with content :after

Bootstrap scrollable dropdown with content :after

Ask Time:2015-08-12T15:22:27         Author:Simone Torrisi

Json Formatter

I'm tryng to build a scrollable dropdown menu with Bootstrap, with a little triangle on the top margin.

I used the :after selector to style the triangle, and it works only if the dropdown is not scrollable.

As soon as i set the dropdown as scrollable, the :after class is ignored.

This is my custom css for scrollable-menu:

.scrollable-menu {
    height: auto;
    max-height: 500px;
    overflow-x: hidden;
}
.scrollable-menu:after {
    content:"";
    width: 0; 
    height: 0; 
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #e3c7aa;
    position:absolute;
    top:-10px;
    right:30px;
 }

Author:Simone Torrisi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/31958564/bootstrap-scrollable-dropdown-with-content-after
yy