Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap divider for responsive navigation

I want to add horizontal divider on responsive navigation. This is bootstrap responsive view on mobile.

enter image description here

I want to add a divider in between the last two menu items namely "link" and "dropdown" menu items. If i add the following <li class='divider></li>'

in between them, it is not working. is there any other bootstrap way to do it? or we need to create our own classes to achieve this in responsive grid?

like image 425
viji Avatar asked Apr 06 '26 18:04

viji


1 Answers

You will have to write @media queries like below:
See Divider in Browser- Resize browser to check
JSFiddle with Divider in collapsible nav

Screenshot of Browser with Divider

 /* Portrait tablet to landscape and desktop */
 @media (min-width: 768px) and (max-width: 979px) {
    .nav-collapse .nav > li.divider {
    *width: 100%;
    height: 1px;
    margin: 9px 1px;
   *margin: -5px 0 5px;
    overflow: hidden;
   background-color: #e5e5e5;
   border-bottom: 1px solid #ffffff;
     }
     }
 @media (min-width: 600px){
   .nav-collapse .nav > li.divider {
    *width: 100%;
    height: 1px;
    margin: 9px 1px;
   *margin: -5px 0 5px;
   overflow: hidden;
   background-color: #e5e5e5;
   border-bottom: 1px solid #ffffff;
  }
  }
 /* Landscape phones and down */
  @media (max-width: 480px) {
   .nav-collapse .nav > li.divider {
   *width: 100%;
   height: 1px;
   margin: 9px 1px;
  *margin: -5px 0 5px;
  overflow: hidden;
  background-color: #e5e5e5;
  border-bottom: 1px solid #ffffff;
  }
  }
like image 111
Shail Avatar answered Apr 13 '26 05:04

Shail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!