Alignment of Navigation Menu - html

I'm trying to get my sub-menu to align left. The team names are spilling over. Either it needs aligned left or I need to widen the sub-menu. I think I am just over-looking what needs to be done, but I just can't figure it out.
nav {
background-color: #000;
border: 1px solid #000;
border-radius: 4px;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.055);
color: #888;
display: block;
margin: 8px 22px 8px 22px;
overflow: hidden;
width: 90%;
text-align: center;
}
nav ul {
margin: 0;
padding: 0;
}
nav ul li {
display: inline-block;
list-style-type: none;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
nav > ul > li > a > .caret {
border-top: 4px solid #FFF;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
display: inline-block;
height: 0;
width: 0;
vertical-align: middle;
-webkit-transition: color 0.1s linear;
-moz-transition: color 0.1s linear;
-o-transition: color 0.1s linear;
transition: color 0.1s linear;
}
nav > ul > li > a {
color: #FFF;
display: block;
line-height: 56px;
padding: 0 24px;
text-decoration: none;
}
nav > ul > li:hover {
background-color: rgb(40, 44, 47);
}
nav > ul > li:hover > a {
color: rgb(255, 255, 255);
}
nav > ul > li:hover > a > .caret {
border-top-color: rgb(255, 255, 255);
}
nav > ul > li > div {
background-color: rgb(40, 44, 47);
border-top: 0;
border-radius: 0 0 4px 4px;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.055);
display: none;
margin: 0;
opacity: 0;
position: absolute;
width: 165px;
visibility: hidden;
z-index: 100;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
nav > ul > li:hover > div {
display: block;
opacity: 1;
visibility: visible;
}
nav > ul > li > div ul > li {
display: block;
}
nav > ul > li > div ul > li > a {
color: #fff;
display: block;
padding: 12px 24px;
text-decoration: none;
}
nav > ul > li > div ul > li:hover > a {
background-color: rgba(255, 255, 255, 0.1);
}
<nav>
<ul>
<li>Home
</li>
<li>Teams <span class="caret"></span>
<div>
<ul>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
<li>Link
</li>
</ul>
</div>
</li>
<li>Link
</li>
<li>Link
</li>
</ul>
</nav>

Related

sub list items not showing up on hover

My problem is that the 3rd menu level is not showing up on the website.
- FISMA and HiPAA are not showing up on my menu. they should be under the Audit and Assessment which is also under Services
/* start h_menu */
.h_menu4 {
float: center;
}
.toggleMenu {
display: none;
background: rgba(29, 82, 99, 0.22);
padding: 10px 15px;
width: 100%;
color: #fff;
}
.nav {
list-style: none;
*zoom: 1;
}
.nav:before,
.nav:after {
content: " ";
display: table;
}
.nav:after {
clear: both;
}
.nav ul {
list-style: none;
width: 9em;
}
.nav li a {
display: block;
padding: 10px 20px 40px 20px;
color: #fff;
font-size: 1em;
}
.nav li {
position: relative;
}
.nav li.active a,
.nav li a:hover {
border-bottom: 10px solid #23aae1;
}
.nav > li {
float: left;
}
.nav > li > a.parent {
background: url(../images/plus.png) no-repeat right top 16px;
}
.nav > li > a:hover {
color: #23aae1;
}
.nav li ul {
position: absolute;
left: -9999px;
}
.nav > li.hover > ul {
left: 0px;
}
.nav li li.hover ul {
left: 100%;
top: 0;
-webkit-transition: background .2s linear;
-moz-transition: background .2s linear;
-ms-transition: background .2s linear;
-o-transition: background .2s linear;
transition: background .2s linear;
}
.nav li li a {
font-size: 0.8725em;
padding: 10px;
display: block;
color: #fff;
background: rgba(73, 93, 137, 0.56);
position: relative;
z-index: 9999;
border-top: 1px solid rgba(233, 233, 233, 0.09);
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.nav li li li a {
background: #0a2334;
z-index: 200;
border-top: 1px solid #1d7a62;
}
.nav li li a:hover {
background: #041420;
color: #fff;
border-bottom: none;
}
<ul class="nav">
<li>About Us
</li>
<li>Solutions
<ul>
<li>Healthcare IT Solutions
</li>
<li>Government IT Solutions
</li>
</ul>
</li>
<li>Services
<ul>
<li>Risk Management
</li>
<ul>
<li>Cyber Risk & Security Controls Assessment
</li>
<li>CyberSprint Advisory
</li>
</ul>
<li>Audit & Assessment
</li>
<ul>
<li>FISMA
</li>
<li>HIPAA
</li>
</ul>
<li>Disaster Recovery & Business Continuity Planning
</li>
</ul>
</li>
<li>Contact
</li>
</ul>
sorry guys I'm quite new at this and not really used into deep coding. Every help would be much appreciated.
The problem was that <li>Risk Management</li> had to wrap submenu <ul> ... </ul>.
/* start h_menu */
.h_menu4 {
float: center;
}
.toggleMenu {
display: none;
background: rgba(29, 82, 99, 0.22);
padding: 10px 15px;
width: 100%;
color: #fff;
}
.nav {
list-style: none;
*zoom: 1;
}
.nav:before,
.nav:after {
content: " ";
display: table;
}
.nav:after {
clear: both;
}
.nav ul {
list-style: none;
width: 9em;
padding: 0;
}
.nav li a {
display: block;
padding: 10px 20px 40px 20px;
color: #000000;
font-size: 1em;
}
.nav li {
position: relative;
}
.nav li.active a,
.nav > li:hover > a {
border-bottom: 10px solid #23aae1;
}
.nav > li {
float: left;
}
.nav > li > a.parent {
background: url(../images/plus.png) no-repeat right top 16px;
}
.nav > li:hover > a {
color: #23aae1;
}
.nav li ul {
position: absolute;
left: -9999px;
}
.nav > li:hover > ul {
left: 0px;
}
.nav li li:hover ul {
left: 100%;
top: 0;
-webkit-transition: background .2s linear;
-moz-transition: background .2s linear;
-ms-transition: background .2s linear;
-o-transition: background .2s linear;
transition: background .2s linear;
}
.nav li li a {
font-size: 0.8725em;
padding: 10px;
display: block;
color: #fff;
background: rgba(73, 93, 137, 0.56);
position: relative;
z-index: 9999;
border-top: 1px solid rgba(233, 233, 233, 0.09);
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.nav li li li a {
background: #0a2334;
z-index: 200;
border-top: 1px solid #1d7a62;
}
.nav li li a:hover {
background: #041420;
color: #fff;
border-bottom: none;
}
<ul class="nav">
<li>About Us
</li>
<li>Solutions
<ul>
<li>Healthcare IT Solutions
</li>
<li>Government IT Solutions
</li>
</ul>
</li>
<li>Services
<ul>
<li>Risk Management
<ul>
<li>Cyber Risk & Security Controls Assessment
</li>
<li>CyberSprint Advisory
</li>
</ul>
</li>
<li>Audit & Assessment
</li>
<ul>
<li>FISMA
</li>
<li>HIPAA
</li>
</ul>
<li>Disaster Recovery & Business Continuity Planning
</li>
</ul>
</li>
<li>Contact
</li>
</ul>

html and css3 menu link clickable not work properly

Hi all I have simple menu but I don't know how to make link in whole square. Now only working on link click.
<ul><li>Menu 1</li>
<li>Menu 2</li>
<li>
Menu 3
<ul>
<li>Menu 4</li>
<li>Menu 5</li>
<li>Menu 6</li>
</ul>
</li>
</ul>
CSS:
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #fff;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
ul li:hover {
background: #555;
color: #fff;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
ul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover { background: #666; }
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
JSFiddle Demo
Remove the padding from li and add it to the a instead. Also set your a to display:block.
Move your padding from the <li> to the <a> and set your anchor to display: block;
/* add this selector */
li > a {
padding: 15px 20px;
display: block;
}
Your updated jsFiddle: https://jsfiddle.net/q5y1sg9v/1/
It will open the link when the element gets clicked. You want it to open the link when the grey box is clicked.
Therefore you have to make the size of the same size as the grey box. And as the others pointed out you will have to remove the padding from li and give it to a instead (or specify its height and width).

Third level drop down css wont show & content/links are out of order?

Some of the sub menu links of the third level are being shown in the second level while some of the second level content are not shown at all. On top of that, I don't know how to get the third level to appear at all. I'm sorry, I'm very new to this.
HTML:
<ul>
<li>Home</li>
<li>Bio</li>
<li>Portfolio
<ul>
<li>Design</li>
<ul>
<li>Illustartor</li>
<li>InDesign</li>
<li>Photoshop</li>
</ul>
<li>Media</li>
<ul>
<li>Photography</li>
<li>Video</li>
</ul>
<li>Traditional</li>
<ul>
<li>Paintings</li>
<li>Drawings</li>
</ul>
</ul>
</li>
<li>FAQ</li>
<li>Contact</li>
</ul>
CSS:
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
top: 400px;
index-z: 3;
}
ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #fff;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
width: 141px;
}
ul li:hover {
background: #555;
color: #fff;
-webkit-transition: delay .5s ease-in-out;
-moz-transition: delay .5s ease-in-out;
-o-transition: delay .5s ease-in-out;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
ul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover { background: #666; }
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
li ul li ul{ /* Third Level & beyond ***********/
display:none;
background:#55aa7f;
}
li ul li:hover ul{
display:block;
position:absolute;
left:100%;
border-left:solid 3px #fff;
top:0;
width:auto;
}
li ul li ul li{
display:block;
padding:3px 10px;
border-top:solid 3px #fff;
white-space:nowrap;
}
li ul li ul li:hover span{
color:#fff;
}
.levelThreeAlign{position:relative;}
You have closed each list item in the submenu before the ul for the sub-submenu.
html should look like this fiddle:
<ul>
<li>Home</li>
<li>Bio</li>
<li>Portfolio
<ul>
<li>Design
<ul>
<li>Illustartor</li>
<li>InDesign</li>
<li>Photoshop</li>
</ul>
</li>
<li>Media
<ul>
<li>Photography</li>
<li>Video</li>
</ul>
</li>
<li>Traditional
<ul>
<li>Paintings</li>
<li>Drawings</li>
</ul>
</li>
</ul>
</li>
<li>FAQ</li>
<li>Contact</li>
</ul>
I have changed some of the css in the fiddle as well utilizing direct descendent selectors. Inheritance is very important here. when you style ul li { that will cascade down to ul li ul li { as you are styling all li that are children of a ul. doesn't matter how many levels deep.

Having trouble getting horizontal 3 level css menu to show 3rd level proplerly. I have included html and css

I'm having trouble creating the third level fligh out for a horizontal css menu. I've tried many different changes to the css to no avail. I have included the menu html and the css. What changes do I need to make to the css to have it work?
When 'ADD SCORES' is hovered over the 2 menus should show to the right
#menu {
background-color: #66A366;
padding: 6px 0 6px 20px;
}
#menu ul li a {
color: #fff;
text-decoration: none;
font-family:"Arial Narrow", "Myriad Pro";
}
#menu li {
color: #fff;
text-decoration: none;
font-family:"Arial Narrow", "Myriad Pro";
}
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
ul li {
font: bold 14px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #66A366;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
ul li:hover {
background: #555;
color: #fff;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
z-index:1000;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
ul li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover {
background: #666;
}
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
ul li ul li:hover li{
display: block;
opacity: 1;
visibility: visible;
}
ul li ul li ul li{
padding: 15px 20px;
font: bold 14px/18px sans-serif;
display: none;
position: relative;
top: -48px;
left: 154px;
width: 120px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
opacity: 0;
z-index:1000;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
<div id="menu">
<ul>
<li>SCORES
<ul>
<li>ADD SCORES
<ul>
<li>Level 3-A-1</li>
<li>Level 3-A-2</li>
</ul>
</li>
<li>EDIT SCORES</li>
</ul>
</li>
<li>PLAYERS
<ul>
<li>ADD PLAYER</li>
<li>EDIT PLAYERS</li>
</ul>
</li>
<li>COURSES
<ul>
<li>ADD COURSE</li>
<li>EDIT COURSES</li>
</ul>
</li>
<li>ADMIN</li>
</ul>
</div>
Demo FIDDLE
I'm not sure how you want your menu to look like, but I noticed that you forgot to wrap the tabs inside a <ul></ul> tag.
If you do that, the menu will look and behave like what most users would expect.
<div id="menu">
<ul> <-- here
<li>SCORES
// some code
<li>ADMIN</li>
</ul> <-- and here
</div>
You can save your time using Swimbi - Swift Menu Builder
- http://f-source.com/swimbi/
have a look at menu demo

CSS menu is being overlapped by text

My css menu is being overlapped by my text at the bottom, this is causing the menu to be rendered useless as when you hover over it and initiate the drop down the text overlaps and the menu comes back up.
i would really appreciate the help with the coding. I am a absolute newbie. if there are changes to the code please could you tell me where to put them.
a link to the menu is at http://stock-trade-101.com/market-indicators/
css code
#cssmenu ul {
margin: 0;
padding: 0;
}
#cssmenu li {
margin: 0;
padding: 0;
}
#cssmenu a {
margin: 0;
padding: 0;
}
#cssmenu ul {
list-style: none;
}
#cssmenu a {
text-decoration: none;
}
#cssmenu {
height: 70px;
background-color: #232323;
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.4);
width: auto;
}
#cssmenu > ul > li {
float: left;
margin-left: 15px;
position: relative;
}
#cssmenu > ul > li > a {
color: #a0a0a0;
font-family: Verdana, 'Lucida Grande';
font-size: 15px;
line-height: 70px;
padding: 15px 20px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#cssmenu > ul > li > a:hover {
color: #ffffff;
}
#cssmenu > ul > li > ul {
opacity: 0;
visibility: hidden;
padding: 16px 0 20px 0;
background-color: #fafafa;
text-align: left;
position: absolute;
top: 55px;
left: 50%;
margin-left: -90px;
width: 180px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
#cssmenu > ul > li:hover > ul {
opacity: 1;
top: 65px;
visibility: visible;
}
#cssmenu > ul > li > ul:before {
content: '';
display: block;
border-color: transparent transparent #fafafa transparent;
border-style: solid;
border-width: 10px;
position: absolute;
top: -20px;
left: 50%;
margin-left: -10px;
}
#cssmenu > ul ul > li {
position: relative;
}
#cssmenu ul ul a {
color: #323232;
font-family: Verdana, 'Lucida Grande';
font-size: 13px;
background-color: #fafafa;
padding: 5px 8px 7px 16px;
display: block;
-webkit-transition: background-color 0.1s;
-moz-transition: background-color 0.1s;
-o-transition: background-color 0.1s;
transition: background-color 0.1s;
}
#cssmenu ul ul a:hover {
background-color: #f0f0f0;
}
#cssmenu ul ul ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: -16px;
left: 206px;
padding: 16px 0 20px 0;
background-color: #fafafa;
text-align: left;
width: 180px;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
#cssmenu ul ul > li:hover > ul {
opacity: 1;
left: 190px;
visibility: visible;
}
#cssmenu ul ul a:hover {
background-color: #cc2c24;
color: #f0f0f0;
}
HTML code for CSS menu
<div id='cssmenu'>
<ul>
<li class='has-sub'><a href='#'><span>Trending</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Support and Resisrance</span></a>
<ul>
<li><a href='#'><span>Creation of Support</span></a></li>
<li><a href='#'><span>Creation of Resistance</span></a></li>
<li><a href='#'><span>Broken Support Becoming Resistance</span></a></li>
<li><a href='#'><span>Broken Resistance Becoming Support</span></a></li>
<li class='last'><a href='#'><span>Significance of Support and Resistance</span></a></li>
</ul>
</li>
<li><a href='#'><span>Dow Theory</span></a></li>
<li><a href='#'><span>Channel Lines</span></a></li>
<li><a href='#'><span>Trendlines</span></a></li>
<li class='last'><a href='#'><span>Fan Principle</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>Chart Patterns</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Head And Shoulders Pattern</span></a>
<ul>
<li><a href='#'><span>Formation In Bull Market</span></a></li>
<li class='last'><a href='#'><span>Formation in Bear Market</span></a></li>
</ul>
</li>
<li><a href='#'><span>Key Reversal</span></a></li>
<li class='has-sub'><a href='#'><span>Symmetrical Triangles</span></a>
<ul>
<li><a href='#'><span>Ascending Triangle</span></a></li>
<li class='last'><a href='#'><span>Descending Triangle</span></a></li>
</ul>
</li>
<li><a href='#'><span>Rectangles</span></a></li>
<li><a href='#'><span>Flags</span></a></li>
<li class='last'><a href='#'><span>Pennants</span></a></li>
</ul>
</li>
<li class='has-sub last'><a href='#'><span>Oscillators and indicators</span></a>
<ul>
<li><a href='#'><span>Leading and Lagging</span></a></li>
<li><a href='#'><span>RSI</span></a></li>
<li><a href='#'><span>Stochastic Oscillator </span></a></li>
<li class='last'><a href='#'><span>MACD</span></a></li>
</ul>
</li>
</ul>
</div>
Finally got it, the text had a z-index set on it, causing it to render above the menu.
Remove the following, and your problem is solved:
.sqs-block {
position: relative;
clear: both;
z-index: 1;
}