How to draw lines through Bootstrap vertical dividers?

81,167

Solution 1

First you had a typo in the .dropdown-toggle class.

Then, you are not looking for a vertical divider, which would look like a border, but for a border, and you just need to hide some of it.

Here is your clue :

.navbar .nav > li > a.dropdown-toggle {
    position: relative;
    bottom: -1px;
    z-index: 1005;
    background: white;
    padding-bottom: 12px;
}

ul.nav li.dropdown:hover ul.dropdown-menu {
    /* ... */
    border-top: 1px solid #000;
}

The padding-bottom is actually just one more pixel than defined by default.

The other important thing is the position to left or right :

ul.nav li.dropdown:hover ul.dropdown-menu {  
    /* ... */
    left: 0px;
}

I fixed a few other things for better effects, but you have the main idea.

Updated jsfiddle

Solution 2

simply use

<hr class="divider">

that should give you what you want

Solution 3

Now there is:

<li class="divider"></li>

Solution 4

If I understood you correctly

<li><hr></li>

Should be useful

Share:
81,167
deny7ko
Author by

deny7ko

Energetic developer who likes to create products for solving people problems.

Updated on July 16, 2022

Comments