Add separator in menu

Hello,

Is there a way to add some kind of separator in menu? (with security module enabled)?

I’ve tried How to add an separator in a menu?
with no luck

Hello
Yes you can add separators in menus, with simple CSS fixes
menu

For this example use theme of menu: crystaline/black

To create a menu separator add an item to the menu with LINK: http://separator
this way we can select it with CSS

menu OnLoad use this code:

echo '<style>
.scMenuHTableCssAlt {
    background-color: #f9fafc;
    border: 1px solid #d0dce1;
}
ul#css3menu1 li.toproot>a {
    color: #3f4958;
	opacity: 1;
}
ul#css3menu1 li.toproot:hover>a, ul#css3menu1 li.toproot a.pressed {
    border: 1px solid #d0dce1;
    z-index: 100;
    position: relative;
    background: #fff;
    top: 1px;
    border-bottom: none;
}
ul#css3menu1 {
    background: none;
}
ul#css3menu1 ul a {
    background-color: #fff;
    color: #3f4958;
    border: 1px solid #fff;
	padding: 5px 15px;
}

ul#css3menu1 ul {
	border-radius:0px;
    background-color: #ffffff;
    border: 1px solid #d0dce1;
    opacity: 1;
	padding: 2px 5px 5px 5px;
	box-shadow: #cccccc45 5px 4px 5px;
}
ul#css3menu1 ul li:hover>a, ul#css3menu1 ul li a.pressed {
    background-color: #f9fafc;
    color: #FFFFFF;
    color: #3f4958;
	border: 1px solid #d0dce1;
	border-radius: 3px;

}
ul#css3menu1 ul span:after{
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #7e7e7e;
    content: \'\';
    position: absolute;
    right: 5px;
    top: 11px;

}
ul#css3menu1 ul span{
	background:none;
}
ul#css3menu1 ul ul {

    border-color: #d0dce1;
}

ul#css3menu1 ul a[item-href*="http://separator"]{
	font-size: 0;
	border-top:1px solid #ccc;
	border-radius:0px;
	padding: 0px;
}

ul#css3menu1 ul li:hover>a[item-href*="http://separator"] {
    background-color: #fff;
	border:none;
	border-top:1px solid #ccc;
	border-radius:0px;
	padding: 0px;
}

</style>';

this part does the trick hiding the text of the item with http://separator and adding a horizontal line:


ul#css3menu1 ul a[item-href*="http://separator"]{
	font-size: 0;
	border-top:1px solid #ccc;
	border-radius:0px;
	padding: 0px;
}

ul#css3menu1 ul li:hover>a[item-href*="http://separator"] {
    background-color: #fff;
	border:none;
	border-top:1px solid #ccc;
	border-radius:0px;
	padding: 0px;
}
2 Likes

excellent ! Works very well, great job HiramBQ

1 Like

Or you could just put something like :

<hr style="height:1px;border-width:0;color:gray;background-color:gray">

in the menu items Text field and leave it with out any link.