Menu items and social icons do not align correctly - css

I am trying to load a line of social icons and then underneath that a line of menu items.
The alignment is not 100% right-aligned and in IE. Instead, the menu items get shoved all the way over to the left.
The ideal look on all browsers should be :
Code in a bootply
I'm using bootstrap 2.2.2
HTML:
<div class="row-fluid" id="top-header" style="background: #fff url(http://www.inter-active.co.za/images/background-top.jpg) top center;">
<!-- Navigation -->
<div class="sticky-wrapper" id="navigation-sticky-wrapper" style="height: 108px;">
<div class="navbar navbar-fixed-top" id="navigation">
<div class="container no-padding">
<div id="logo">
<img src="images/logo.png">
</div>
<div class="navbar-inner">
<a class="show-menu" data-target=".nav-collapse" data-toggle="collapse">
<span class="show-menu-bar"></span>
</a>
<div class="nav-collapse collapse">
<ul class="social">
<li class="social"><img alt="" src="http://www.inter-active.co.za/images/twitter.png" ></li>
<li class="social"><img alt="" src="http://www.inter-active.co.za/images/linkedin.png"></li>
<li class="social"><img alt="" src="http://www.inter-active.co.za/images/facebook.png"></li>
</ul>
<br>
<ul class="nav">
<li class="menu"><a class="colapse-menu1" href="#home">Home</a></li>
<li class="menu"><a class="colapse-menu1" href="#sectionA">About Us</a></li>
<li class="menu"><a class="colapse-menu1" href="#solutions">Solutions</a></li>
<li class="menu"><a class="colapse-menu1" href="#news">News</a></li>
<li class="menu"><a class="colapse-menu1" href="#contact-parallax">Careers</a></li>
<li class="menu"><a class="colapse-menu1" href="#contact">Contact Us</a></li>
</ul>
</div>
</div>
</div>
</div>
</div><!--/Navigation -->
</div>
CSS:
#logo {
width:180px;
height:100px;
padding:4px;
position:absolute;
}
#navigation-sticky-wrapper {
height:45px;
}
ul.socials-icons-top li {
width:35px;
height:35px;
display:inline-block
}
ul.socials-icons-top li a {
opacity:0.5;
transition:all 0.3s ease 0s;
-moz-transition:all 0.3s ease 0s;
-webkit-transition:all 0.3s ease 0s;
-o-transition:all 0.3s ease 0s;
}
ul.socials-icons-top li a:hover {
opacity:1;
}
#navigation-sticky-wrapper {
height:120px;
}
.is-sticky {
background-color:#fff;
width:100%;
height:121px;
background: #fff url(../images/background-top.jpg) top center;
width:100%;
}
.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {
float:right;
margin-right:20px;
}
.navbar-inner {
box-shadow: none !important;
min-height: 45px;
line-height: 20px !important;
transition: all 0.3s ease-out 0s;
border-bottom: none !important;
padding-left: 10px !important;
padding-right: 10px !important;
background: transparent;
margin-top: 55px;
}
.navbar {
position: relative;
float:right;
padding 0 20px;
width:100%
}
li.social {
width:32px;
height:32px;
display:inline-block;
}
ul.social {
float:right;
margin-right:250px;
margin-bottom:2px;
}
.navbar .nav {
width:960px;
text-align:center;
margin: 0 10px 10px 0;
}
.navbar .nav > li {
float:none;
display:inline-block;
width:auto;
}
.navbar .nav > li.menu {
margin-right:5px;
margin-top:5px;
}
.navbar .nav > li > a {
font-family:'Calibri', 'Arial', sans-serif;
text-transform:uppercase;
font-weight:400;
font-size:14px;
color: #e76f25;
display: block;
transition: all 0.3s ease-out 0s;
line-height: 14px;
text-shadow: none;
height:16px;
padding: 0px;
}
ul.menu>li:last-child a {
border:none;
}
.navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus {
background: none;
box-shadow: none;
color: #222222;
height: 100%;
transition: all 0.3s ease-out 0s;
}
.navbar .nav > li > a:focus, .navbar .nav > li > a:hover {
color: #333;
text-decoration: none;
height: 100%;
transition: all 0.3s ease-out 0s;
}
.navbar .show-menu {
float: right;
width:30px;
margin: 7px 30px 7px 10px;
height: 31px;
padding:2px;
background:url(../images/responsive-menu.png) no-repeat 2px 2px;
background-size:30px 30px;
cursor:pointer;
border-radius:3px;
opacity:0.7;
display:none
}
.navbar .show-menu:hover {
opacity:1;
}

You have added,
a. 250px of right margin for the ul that has the class 'social'.
Figure - 1
b. And 10px of right margin for nav beneath social.
Figure - 2
To align that you need to set the text-align to right add 240px [a - b] of padding-right for nav.
Here is the CSS Code;
.navbar .nav {
margin: 0 10px 10px 0;
padding-right: 240px; /** 250px - 10px **/
text-align: right; /**/
width: 960px;
}
And additionally, there is 5px of right margin for each li in ul has a class of nav. This makes the menu links to be offset to left by 5px.
To fix that you need to add this block of CSS code;
.navbar .nav > li:last-child {
margin-right: 0;
}
Hope this will help. [This is my first Stackoverflow answer ;)]

Related

Submenu vanishes after mouse off main menu item

Could someone explain to me why navigating away from the main menu item causes the sub-menu to vanish? And possibly provide a fix. My google-foo skills are below par this morning. Thanks all.
CSS:
body, html{
margin: 0;
}
.content{
padding: 30px;
}
.nav-main{
width: 100%;
background-color: #222;
height: 70px;
color: #fff;
}
.nav-main > ul{
margin: 0;
padding: 0;
float: left;
list-style-top: none;
}
.nav-main > ul > li {
float: left;
}
.nav-item {
display: inline-block;
padding: 15px 20px;
height: 40px;
line-height: 40px;
color: #fff;
text-decoration: none;
}
.nav-item:hover{
background-color: #444;
}
.nav-content{
position: absolute;
top: 70px;
overflow: hidden;
background-color: #222; /* same color as main nav*/
max-height: 0; /*will not display if .nav-content no padding */
}
.nav-content a{
color: #fff;
text-decoration: none;
}
.nav-content a:hover{
text-decoration: underline;
}
.nav-sub{
padding: 20px;
}
.nav-sub ul{
padding: 0;
margin: 0;
list-style-type: none;
}
.nav-sub > ul > li{
display: inline-block;
}
.nav-sub ul li a{
padding: 5px 0;
}
.nav-item:focus{
background-color: #444; /*remove if click focus not necessary*/
}
.nav-item:hover ~ .nav-content{
max-height: 400px;
-webkit-transition:max-height 0.6s ease-in;
-moz-transition:max-height 0.6s ease-in;
transition:max-height 0.6s ease-in;
}
HTML:
<body>
<nav class="nav-main">
<ul>
<li>
first
<div class="nav-content">
<div class="nav-sub">
<ul>
<li>this is a thing</li>
<li>this is a thing 2</li>
</ul>
</div>
</div>
</li>
<li>
second
</li>
<li>
third
</li>
</ul>
</nav>
<div class="content">this is content</div>
</body>
I have changed:
.nav-item:hover ~ .nav-content{
To
nav > ul > li:hover > .nav-content{
And now it's working - example:
https://jsfiddle.net/saxkayv2/

issue styling bootstrap navbar when collapse

I am using the below css in my code to achieve a transparent white navbar but after collapsing menu in mobile version background style doesn't work. please help me to overcome this issue. i tried most of the solutions found in other questions
#header_wrapper {
background: rgba(255, 255, 255, 0.82);
}
.header_box {
position: relative;
}
.header{
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 15px 0px 10px 0px;
z-index: 10000;
transition: all 0.2s ease-in;
height: 100px;
background-color:transparent;
text-align: center;
line-height: 40px;
}
.header.active {
background: rgba(255, 255, 255, 0.82);
}
.logo {
float: left;
position: relative;
z-index: 2;
}
.res-nav_click {
display: none;
}
/* Nav Styles
---------------------------------*/
.navbar-inverse {
background-color: transparent;
border-color: transparent;
}
.navbar {
border: 0px solid #fff;
min-height: 40px;
margin-bottom: 0px;
}
.navbar-inverse .navbar-nav > li > a {
color: #000;
}
.navStyle {
float: right;
}
.navStyle ul {
list-style: none;
padding: 0px;
margin-top:25px;
}
.navStyle ul li {
display: inline-block;
margin: 0 5px;
}
.navStyle ul li:first-child {
/*margin:0px;*/;
}
.navStyle ul li:last-child {
margin: 0 0 0 23px;
}
.navStyle ul li a {
display: block;
font-size: 15px;
color: #222222;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
text-decoration: none;
text-transform: uppercase;
font-weight: 300;
transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
}
.navStyle ul li a:hover {
color: #ffc000;
border: 0px solid #fff;
}
.navStyle > li > a:hover, .nav > li > a:focus {
text-decoration: none;
color: #ffc000;
background-color: transparent;
}
.navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus {
color: #ffc000;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
color: #ffc000;
background-color: transparent;
}
.navStyle > li.active > a,
.navStyle > li.active > a:hover {
text-decoration: none;
color: #ED5441;
background-color: transparent;
}
HTML:
<header id="header_wrapper" class="header active border">
<div class="container">
<div class="header_box">
<div class="logo"><img src="images/logo.png" alt="logo"></div>
<nav class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
</div>
<div id="main-nav" class="collapse navbar-collapse navStyle">
<ul class="nav navbar-nav" id="mainNav">
<li class="active">Home
Home
</li>
<li>About Us
About Us
</li>
<li>Products
Products
</li>
<li>Services
Services
</li>
<li>Group
Group
</li>
<li>Careers
Career
</li>
<li>Contact Us
Contact Us
</li>
</ul>
</div>
</nav>
</div>
</div>
</header>
http://globaltrendz.com/blackandgreen/ please refer this one by changing header-wrapper bgcolor opactiy. like this one what i need
I am assuming that you want mobile navbar after 765px so you need to use a media query on that.
Add this at the end of your css file:
#media screen and (max-width: 765px){
.navStyle ul{
position: fixed;
left: 0;
background: rgba(255, 255, 255, 0.82) !important; //important //because you have inline styles.
}
}
Here's the output:
got the solution by applying below styles
.navbar-inverse {
background-color: rgba(222,222,222,0.84);
border-color: transparent;
width:100%;
position:fixed;
left:0;
}
.navStyle ul {
background-color: rgba(222,222,222,0.84);
}

HTML5/CSS overflow on dropdowns

I'm building this website as part of college project, I have built my navigation drop downs but there is a kind of over flow on the left of the list items that I can't seem to get rid of. I have tried playing around with the widths and overflow but I just can't seem to get rid of it without messing up the functionality of my dropdown, any help would be greatly appreciated.
wont let me post an image but here is a link: http://postimg.org/image/q4uo0sjfp/
This is the CSS
#charset "UTF-8";
html {background:none;}
table{
width:100%;
}
table, th, td {
height:auto;
width:auto;
padding: none;
align: center;
}
.cf:before,
.cf:after {
content:"";
display:table;
}
.cf:after {
clear:both;
}
.cf {
zoom:1;
}
body {
font: 100% Arial, Helvetica, sans-serif;
line-height: 1.4;
width: 100%;
padding-bottom: 0;
background: 8BA0BB;
}
.wrapper{
min-height:100%;
height:100%;
height:auto;
width:auto;
}
h1, h2, h3 {
font-weight: normal;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
color: #174D92;
}
h2 {
font-size: 4.4em;
font:100% Arial, Helvetica, sans-serif;
color:#174D92;
font-weight: bold;
}
header{
position:fixed;
width:100%;
height:206px;
max-width:100%;
max-height:100%;
float:left;
top:0;
left:0;
background:#ffffff;
z-index:999;
}
header img{
height:auto;
width:auto;
max-width:100%;
max-height:100%;
float:left;
}
nav {
height: 3.1em;
width:100%;
background:#174D92;
text-align:center;
position:fixed;
top:200px;
z-index:999;
}
div {
background:#7FB7FF;
margin: 2px;
border: 1px solid #174D92;
Border-radius:25px;
Padding: 2px 2px 2px 2px;
}
.insurers a img{
border: 1px solid #174D92;}
.insurers a:hover img{
border: 3px solid #174D92;
opacity:0.4;
}
div.textsmall{font-size: 85%}
ul, li {
float:left;
padding:none;
margin: 0;
list-style:none;
width: 20%;
height: auto;
text-align:center;
font-weight: bold;
}
ul {
background: #7FB7FF;
width:97.6%;
height:2.9em;
text-align: center;
vertical-align:central;
margin-top:.1em;
}
li {
position:relative;
}
li a {
display:block;
width: auto;
padding:none;
line-height:2.9em;
text-decoration:none;
color: #174D92;
}
li a:hover, .topmenu > li:hover > a{
background:#174D92;
color: #7FB7FF;
border-left: 1px solid black;
border-right: 1px solid black;
}
ul.topmenu{text-align:center;
}
ul.submenu {
background:#7FB7FF;
width: 100%;
height: auto;
float:none;
position:absolute;
top:2.9em;
left:10000em;
max-height: 0;
transition:max-height 1s ease-in-out;
-webkit-transition: max-height 1s ease-in-out;
-moz-transition: max-height 1s ease-in-out;
-o-transition: max-height 1s ease-in-out;
overflow:hidden;
z-index:999;
}
ul.submenu li {
padding: none;
float: none;
color: #174D92;
width: 100%;
height: auto;
z-index:999;
}
ul.topmenu li:hover ul{
Left:-40px;
max-height: 30em;
width: 100%;
}
ul.submenu li a {
border-bottom: 1px solid #8D8F92;
border-right: 0;
line-height:3em;
padding: none;
white-space: nowrap;
}
ul.submenu li a:hover {
background:#174D92;
color:#7FB7FF;
border-bottom: 1px solid #FFFFFF;
}
ul.submenu li:last-child a {
border-bottom: none;
}
ul.submenu li:first-child a {
padding: none;
}
.fadein { position:relative; width: auto; height: 545px; margin-top: 1em;}
.fadein img { position:absolute; left:0; top:0; border-radius:25px; border: 4px solid #174D92;}
iframe{
margin: 2px;
border: 1px solid #174D92;
}
.divtext{
width:60%;
text-align:center;
}
.aligncent{
align-content:center;
text-align:center;
}
.blank{
background:none;
border:none;
}
HTML
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link href="index.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<title>Physio Central Dublin</title>
</head>
<div class="wrapper blank" style="height:auto; width:100%">
<header><img src="headerimg.png"></header>
</div>
<body>
<nav class="cf">
<ul class="topmenu">
<li>Home</li>
<li>Treatments
<ul class="submenu">
<li>Physiotherapy</li>
<li>Acupuncture</li>
<li>Sports Injury</li>
<li>Osteopathy</li>
<li>Exercise Therapy</li>
<li>Massage Therapy</li>
<li>Orthotics</li>
<li>Dry Needling</li>
</ul>
</li>
<li>Pricing
<ul class="submenu">
<li>Pricing for sessions</li>
<li>Are you covered</li>
</ul>
</li>
<li>About Us
<ul class="submenu">
<li>About Physio Central</li>
<li>Opening Times</li>
<li>Location</li>
<li>Our People</li>
<li>Contact Us</li>
<li>Testimonies</li>
</ul>
</li>
<li>FAQ
<ul class="submenu">
<li>FAQ</li>
</ul>
</li>
</ul>
</nav>
you just need to tell the ul to have zero padding.
ul.submenu {
background:#7FB7FF;
width: 100%;
height: auto;
max-height: 0;
transition:max-height 1s ease-in-out;
-webkit-transition: max-height 1s ease-in-out;
-moz-transition: max-height 1s ease-in-out;
-o-transition: max-height 1s ease-in-out;
overflow:hidden;
z-index:999;
padding: 0px;
}
If you remove the absolute positioning as well then it will drop directly below your menu item, which I assume is what you was after as well.

CSS border under/below list item

I have a list for my navbar. I want to have a border below the active li item, not just on the bottom.
I've been able to add the border to the bottom using border-bottom, but again, it needs to be below the li element. Any help would be appreciated.
Here is my custom css so far, in addition to default Bootstrap navbar list:
.nav .active{
border-bottom: 5px solid yellow;
}
See below:
Just an example ..... use border-bottom with background-clip padding box
ul {
list-style-type: none;
}
li {
height: 50px;
width: 180px;
line-height: 50px;
border-bottom: 5px solid transparent;
background: #ddd;
display: inline-block;
text-align: center;
background-clip: padding-box;
}
li:hover {
border-bottom: 5px solid gold;
}
<ul>
<li>Hello</li>
<li>World</li>
</ul>
Altarnatively you can try box shadow. see this
ul {
list-style-type: none;
}
li {
height: 50px;
width: 180px;
line-height: 50px;
background: #ddd;
display: inline-block;
text-align: center;
}
li:hover {
box-shadow: 0 5px 0 0 gold;
}
<ul>
<li>Hello</li>
<li>World</li>
</ul>
Try like this: demo
CSS:
ul.nav {
list-style-type: none;
}
li {
display:block;
float:left;
line-height: 26px;
margin-right:10px;
background-color:#ccc;
padding:4px 10px;
border-bottom: 5px solid transparent;
}
li a{
text-decoration:none;
color:#000;
}
li:hover, li.active {
border-bottom: 5px solid red;
}
HTML:
<ul class="nav">
<li> Menu 1
</li>
<li class="active"> Menu 1
</li>
<li> Menu 1
</li>
<li> Menu 1
</li>
</ul>
I typically use an :after for small details like this, to get the border outside the menu items normal height.
HTML:
<ul>
<li>Home</li>
<li class="active">About</li>
<li>Contact</li>
<li>Blog</li>
</ul>
<div class="main">
Next Box
</div>
CSS:
html,body{
margin:0px;
padding:0px;
}
ul{
/* for looks */
list-style:none;
margin:0px;
padding:0px;
}
li{
background:black;
color:white;
display:inline-block;
margin:0px;
padding:5px 20px;
}
li.active{
position:relative;
}
li.active:after{
content:'';
position:absolute;
top:100%;
left:0px;
border-top:5px solid yellow;
width:100%;
}
.main{
background-color:#dddddd;
min-height:400px;
}
Most of the css is just for presentation but the key stuff is on the li, the li.active, and the li.active:after.
You can check out my demo at jsfiddle
This is the sample I always use. Hope this can help you ;)
This method is using the last child of the "li" element as the border.
The class "selected" on "li" element choose the position of the border to stay at initial.
When the mouse is on one of the menu bar button, the bar will follow it by an animation.
If you don't want an animation, please just delete ALL transition CSS style in ".menu > li:last-child" class.
If you want to know more about last child CSS style, please go to this link >> http://www.w3schools.com/cssref/sel_last-child.asp
.menu, .menu li {
margin: 0;
padding: 0;
list-style: none;
display: inline-block;
}
.menu {
margin: auto;
position: relative;
overflow: hidden;
height: 25px;
}
.menu li {padding: 0px 5px;}
.menu > li {
text-align: center;
width: 80px;
font-size: 14px;
}
.menu > li > a {
display: block;
padding: 0px 0px;
color: #444;
text-decoration: none;
font-size: 15px;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-ms-transition: color 0.5s ease;
-o-transition: color 0.5s ease;
transition: color 0.5s ease;
}
.menu li a:hover {
color: #ffa500;
}
.menu > li:last-child {
position: absolute;
top: 20px;
right: -90px;
height: 5px;
width: 80px;
background: #ffa500;
-webkit-transition: transform 0.5s ease;
-moz-transition: transform 0.5s ease;
-ms-transition: transform 0.5s ease;
-o-transition: transform 0.5s ease;
transition: transform 0.5s ease;
}
.menu .selected {
position: relative;
pointer-events: none;
cursor: default;
}
.selected a {
color: #ffa500 !important;
}
.menu li:nth-child(1):hover ~ li:last-child {
-webkit-transform:translateX(-375px) !important;
-moz-transform:translateX(-375px) !important;
-ms-transform:translateX(-375px) !important;
-o-transform:translateX(-375px) !important;
transform:translateX(-375px) !important;
}
.menu li:nth-child(1).selected ~ li:last-child {
-webkit-transform:translateX(-375px);
-moz-transform:translateX(-375px);
-ms-transform:translateX(-375px);
-o-transform:translateX(-375px);
transform:translateX(-375px);
}
.menu li:nth-child(2):hover ~ li:last-child {
-webkit-transform:translateX(-280px) !important;
-moz-transform:translateX(-280px) !important;
-ms-transform:translateX(-280px) !important;
-o-transform:translateX(-280px) !important;
transform:translateX(-280px) !important;
}
.menu li:nth-child(2).selected ~ li:last-child {
-webkit-transform:translateX(-280px);
-moz-transform:translateX(-280px);
-ms-transform:translateX(-280px);
-o-transform:translateX(-280px);
transform:translateX(-280px);
}
.menu li:nth-child(3):hover ~ li:last-child {
-webkit-transform:translateX(-185px) !important;
-moz-transform:translateX(-185px) !important;
-ms-transform:translateX(-185px) !important;
-o-transform:translateX(-185px) !important;
transform:translateX(-185px) !important;
}
.menu li:nth-child(3).selected ~ li:last-child {
-webkit-transform:translateX(-185px);
-moz-transform:translateX(-185px);
-ms-transform:translateX(-185px);
-o-transform:translateX(-185px);
transform:translateX(-185px);
}
.menu li:nth-child(4):hover ~ li:last-child {
-webkit-transform:translateX(-90px) !important;
-moz-transform:translateX(-90px) !important;
-ms-transform:translateX(-90px) !important;
-o-transform:translateX(-90px) !important;
transform:translateX(-90px) !important;
}
.menu li:nth-child(4).selected ~ li:last-child {
-webkit-transform:translateX(-90px);
-moz-transform:translateX(-90px);
-ms-transform:translateX(-90px);
-o-transform:translateX(-90px);
transform:translateX(-90px);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div class="menubox">
<ul class="menu">
<li class="selected">
<a href="#">
First
</a>
</li>
<li>
<a href="#">
Second
</a>
</li>
<li>
<a href="#">
Third
</a>
</li>
<li>
<a href="#">
Forth
</a>
</li>
<li></li>
</ul>
</div>
</body>
</html>

Pure CSS3 Navigation Menu child level appears behind parent level

I have a Pure CSS3 Navigation Menu where child level appears behind parent level.
Tried to resolve it by playing with z-index and other elements for 5 days now.
Thanks in advance!
Here's the HTML(direction RTL):
<div id="MainNavMenu">
<div id="main_navigation" class="blue main-menu "><!-- START -->
<ul>
<li class="main_list_item"><a class="main_list_link" href="#">Marketing</a>
<ul>
<li>NPA
<li>PMN
<li>NML
<ul>
<li>Document Library</li> <!-- Third Level -->
</ul>
</li>
<li>Cataloges</li>
<li>Price lists</li>
</ul>
</li>
<li class="main_list_item"><a class="main_list_link" href="#">פיתוח</a>
<ul>
<li>Document Library</li>
<li>Project Management</li>
<li>QA</li>
<li>Administration</li>
<li>R&D Mechanics</li>
<li>Catalog</li>
<li>Mtb</li>
<li>Itbs</li>
<li>Eit</li>
</ul>
</li>
<li class="main_list_item"><a class="main_list_link" href="#">משהו</a>
<ul>
<li>מכונות
<ul>
<li>ליב</li>
<li>MSG</li>
<li>Type</li>
<li>DIff</li>
</ul>
</li>
<li>בטיחות
<ul>
<li>נהלי בג"ס</li>
<li>מפרטים</li>
<li>טפסים</li>
<li>איכות הסביבה</li>
<li>בטיחות וגיהות</li>
<li>בריאות וארגונומיה</li>
<li>מידע ותקנים</li>
<li>MSDS</li>
</ul>
</li>
<li>משק ובטחון
<ul>
<li>ספריות מסמכים</li>
</ul>
</li>
<li>אבטחת איכות
<ul>
<li>מדריכי משתמש</li>
<li>מפרטים מחלקתיים</li>
<li>דו"חות מנטי</li>
<li>תעודות איכות</li>
</ul>
</li>
<li>רכש
<ul>
<li>ספריות מסמכים</li>
<li>חוזי ספק</li>
<li>TTR פלדות</li>
<li>FDT השחזה</li>
</ul>
</li>
</ul>
</li>
<li class="main_list_item"><a class="main_list_link" href="#">חברה שלי</a>
<ul>
<li>ספר טלפונים</li> <!-- SECOND LEVEL MENU -->
<li>טלפונים חשובים</li>
<li>פתיחת תקלת מחשוב</li>
<li>פינת נוסטלגיה</li>
<li>ימי הולדת</li>
<li>שערי מטבע</li>
<li>המתבח של ישקר</li>
<li>אירועים</li>
<li>ספריות מסמכים</li>
<li>משאבי אנוש
<ul>
<li>טפסים</li>
<li>מסמכי ביטוח</li>
<li>מידע והטבות</li>
<li>נהלים</li>
<li>הודעות</li>
<li>אירועים</li>
</ul>
</li>
</ul>
</li>
</ul>
</div> <!-- MAIN NAVIGATION END -->
</div>
Here is CSS:
/**************************************
Navigation Menu
***************************************/
#MainNavMenu
{
left: 1040px;
top: 70px;
position: absolute;
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
margin: auto;
height: 18px;
z-index:3;
}
#main_navigation{
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
margin: auto;
font-size:8px;height:20px;float:right;
outline:none;
margin-bottom:250px;
box-shadow:1px 0px 2px rgba(0,0,0,0.5);
opacity: 1;
border-radius:5px;
}
.main-menu{position:relative;z-index:7;font-family: 'Ariel', tahoma, serif;letter-spacing:0pt; solid;}
.main-menu ul li a, .main-menu ul li a:link, .main-menu ul li a:visited{border-bottom:4pt solid transparent;padding-bottom:1px}
.main-menu ul {
margin:0;
padding:0px;
list-style-type:none;
z-index:5;
border-radius:5px;
}
.main-menu ul li {
position:relative;
display:inline;
float:right;
z-index:4;
}
/*Second level settings*/
.main-menu ul li > ul {
z-index:2;
visibility:hidden;
display:inline;
opacity:0;
padding:0px;margin:0px;
position:absolute;
/*width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;*/
width: 150px;
top:25px;
right:40px;
color:#FFFFFF;
-webkit-transition:all 0.3s ease-in-out;
-moz-transition:width 0.3s ease-in-out;
-o-transition:all 0.3s ease-in-out;
transition:all 0.3s ease-in-out;
}
/*on hover over second level - third level appears*/
.main-menu ul li ul li:hover > ul {
display:block;
visibility:visible;
right:50px;
top: 15px;
opacity: 1;
z-index: 9999;
}
.main-menu ul li:hover > ul {
display:block;
visibility:visible;
right:0px;
display:block;
opacity:1;
}
.main_list_item {
height:20px;
z-index:0;
}
.main-menu ul li a.main_list_link,.main-menu ul li a.main_list_link:link{
line-height:20px;
text-shadow:none;
font-size:12px;
text-transform:uppercase;
}
.main-menu ul li > a {
display:block;
text-decoration:none;
overflow:hidden;
padding:0px 15px;
border-radius:3px;
}
* html .main-menu ul li a {
display:inline-block;
}
.main-menu ul li ul li {
display:list-item;
float:right;
border-left:none!important;
color:#FFFFFF;
padding:0px;margin:0px;
}
.main-menu ul li ul li a {
margin:0px;
-webkit-transition:all 0.3s ease-in-out;
-moz-transition:width 0.3s ease-in-out;
-o-transition:all 0.3s ease-in-out;
transition:all 0.3s ease-in-out;
}
.main-menu ul li ul li{
-webkit-transition:all 0.3s ease-in-out;
-moz-transition:all 0.3s ease-in-out;
-o-transition:all 0.3s ease-in-out;
transition:all 0.3s ease-in-out;
border-bottom:solid 1px #ececec;
width:100%;
}
.main-menu ul ul {
background:#FFFFFF;
border:1px solid #e0e0e0;
-moz-box-shadow:0px 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow:0px 3px 3px rgba(0,0,0,0.1);
box-shadow:0px 3px 3px rgba(0,0,0,0.1);
z-index:9;
color:#707070;
}
.main-menu ul ul li a,.main-menu ul ul li a:visited,.main-menu ul ul li a:link {
height:100%;
text-transform: capitalize;
margin-right:0px!important;
margin-left:0px!important;
font-size:12px;
color:#707070;
z-index:10;
background-color: #FFFFFF ;
}
/*TEMP*/
/*TEMP*/
.main-menu ul ul li:hover > a{
cursor:pointer;
text-decoration:none!important;
padding-right:30px;
right: 40px;
z-index:11;
}
.main-menu ul ul li > a:after{
content:"";
opacity:0;
position:absolute;
right:20px;top:26px;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right:5px solid #FEFEFE;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-o-transition:all 0.2s ease-in-out;
transition:all 0.2s ease-in-out;
z-index:12;
}
/*arrow pointer inside menu item*/
.main-menu ul ul li:hover > a:after{
content:"";
opacity:1;
position:absolute;
right:0px;top:5px;
width: 0;
height: 0;
border-right:5px solid #FEFEFE;
}
.main-menu ul ul ul {
position:absolute;
right: 100px;
top :20px;
}
/***********
Menu Color
************/
/* BLUE */
.blue{
background:#148cfc;
/*border:2px solid #ffd017;*/ /*yellow border*/
}
.blue ul ul{
border-top:2px solid #ffd017;
width:99%;
}
.blue ul ul li:hover > a{
text-decoration:none!important;
color:#FFF!important;
background:#148cfc;
padding-right:30px;
text-shadow:1px 0px 0px #3080b0;
}
.blue ul li a{
color:#FFFFFF;
}
.blue ul li > a:hover,.blue ul li:hover > a{
color:#ffd017!important;
}
/*menu items separator*/
.blue .main_list_item:after{
content:"";
z-index:-1;
position:absolute;
border-right:1px solid #e9e9e9;
box-shadow:1px 0px 0px #057794;
height:15px;
top:3px;
background:#FFF;
}
/*FIXING border */
.main_list_item:first-child:after{
border-right:none;
}
/**************************************
End Of Navigation Menu
***************************************/

Resources