CSS Mobile Navigation menu - drop downs not nesting properly - html

I hope that I'm explaining this clearly. You can view my site at: http://membershq.incentiveusa.com/AwardPages/GoalUp_Test2/index_test2.html
The navigation menu, when in mobile format, has the drop down links on top of the main navigation rather than nesting within and pushing the rest of the links down.
CSS:
.navigation{
margin-right: auto;
margin-left: auto;
width: 100%;
background-color: #0f9cde;
position: absolute;
display: block;
margin-bottom: 15px;
z-index: 1000;
top: 735px;
margin-left: -15px;
}
/*Strip the ul of padding and list styling*/
.navigation ul{
list-style-type: none;
margin: 0 auto;
padding: 0;
position: relative;
z-index: 1000;
text-align:center;
}
/*Create a horizontal list with spacing*/
.navigation li{
display:inline-block;
margin-right: 0px;
background-color:#0f9bde;
vertical-align: top;
}
/*Style for menu links*/
.navigation li a {
min-width: 189px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: 'Maven Pro', sans-serif;
font-size:18px;
color: #fff;
width:100%;
background-color: #0f9cde;
text-decoration: none;
display:block;
}
/*Hover state for top level links*/
.navigation li:hover a {
color: #f7a800;
text-decoration: underline;
}
/*Style for dropdown links*/
.navigation li:hover ul a {
background: #f7a800;
color: #ffffff;
height: 40px;
line-height: 40px;
}
/*Hover state for dropdown links*/
.navigation li:hover ul a:hover {
background: #fff;
color: #f7a800;
}
/*Hide dropdown links until they are needed*/
.navigation li ul{
display: none;
position: absolute;
}
/*Make dropdown links vertical*/
.navigation li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
.navigation li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
.navigation ul li:hover ul{
display:block;
}
/*Display the dropdown on hover*/
.navigation ul li a:hover {
display: block;
}
/*Style 'show menu' label button and hide it by default*/
.show-menu {
font-family:'Maven Pro', sans-serif;
text-decoration: none;
color: #fff;
background: #f7a800;
text-align: center;
padding: 10px 0;
display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
-webkit-appearance: none;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
display: block;
}
#menu ul {min-width: 189px; }
/*Responsive Styles*/
#media screen and (max-width : 975px){
/*Make dropdown links appear inline*/
.navigation ul {
position: static;
display: none;
}
/*Create vertical spacing*/
.navigation li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
.navigation ul li, li a {
width: 100%;
}
.navigation li ul li {
width: 100%;
}
#menu ul {min-width: 100%;}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
}
Here is the HTML:
<div class="container-fluid">
<div class="section-title2 text-center">
<div class="navigation">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
<ul id="menu">
<li>
About Us
<ul>
<li>
News
</li>
</ul>
</li>
<li>
How It Works
<ul>
<li>
Facts
</li>
<li>
Tools
</li>
</ul>
</li>
<li>
Testimonials
</li>
<li>
Brand Name Awards
</li>
<li>
Contact
</li>
</ul>
</div>
</div>
</div>

Your problem has to do with this style:
.navigation li ul{
display: none;
position: absolute;
}
Remove the position: absolute;, probably needed at you mobile break point.
Like this:
#media screen and (max-width : 975px){
.navigation li ul{
position: static;
}
}

Related

Center a horizontal navigation bar?

How can i center this nav bar so it stays in the center of the screen despite the users resolution setting? Also how to stop the dropdown menu on 'Portfolio' stretching the menu?
http://jsfiddle.net/y4vDC/382/
<ul id="menu">
<li>Home</li>
<li>
About
<ul class="hidden">
<li>Who We Are</li>
<li>What We Do</li>
</ul>
</li>
some of the html....
This should get you started. The important thing is that floating makes centering items quite difficult.
display:inline-block works much better as you can center thme list items by applying text-align:center to the parent ul.
Then it's just a case of using positioning to set the location and size of the submenu.
/*Strip the ul of padding and styling*/
ul {
list-style-type: none;
margin: 0;
padding: 0;
/* center contents of menu */
text-align: center;
}
/*Create a horizontal list with spacing*/
li {
display: inline-block;
vertical-align: top;
margin-right: 1px;
/* create positioning context */
position: relative;
}
/*Style for menu links*/
li a {
display: block;
min-width: 140px;
/* removed set height */
min-height: 50px;
line-height: 50px;
text-align: center;
font-family: helvetica, arial, sans-serif;
color: #ffffff;
background: #6BD6FA;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #A0A2A3;
color: #ffffff;
}
/*Hover state for dropdown links*/
li ul a:hover {
background: #bada55;
color: #ffffff;
}
/*Hide dropdown menu until are needed*/
li ul {
display: none;
position: absolute;
top: 100%;
left: 0;
height: auto;
}
/*Show dropdown menu on hover */
li:hover ul {
display: block;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
}
<ul id="menu">
<li>Home
</li>
<li> About
<ul class="hidden">
<li>Who We Are
</li>
<li>What We Do
</li>
</ul>
</li>
<li>Portfolio
<ul class="hidden">
<li>Web & User Interface Design
</li>
</ul>
</li>
<li>News
</li>
<li>Contacts
</li>
</ul>
/*Strip the ul of padding and styling*/
ul {
list-style-type: none;
margin: 0;
padding: 0;
text-align:center;
}
/*Create a horizontal list with spacing*/
li {
display: inline-block;
margin-right: 0px;
}
ul#menu > li{
position:relative;
}
ul > li > ul{
position:absolute;
}
ul > li > ul li{
white-space:nowrap;
}
/*Style for menu links*/
li a {
display: block;
padding:25px 50px;
line-height: 50px;
text-align: center;
font-family: helvetica, arial, sans-serif;
color: #ffffff;
background: #6BD6FA;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a{
background: #A0A2A3;
color: #ffffff;
}
/*Style for dropdown links*/
li:hover a {
background: #A0A2A3;
color: #ffffff;
height: 50px;
line-height: 50px;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #A0A2A3;
color: #ffffff;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
}
/*Display dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
I updated jsfiddle too: http://jsfiddle.net/y4vDC/385/
try this
ul {
list-style-type: none;
margin: 0 auto;
width:80%;
padding:0;
}

While using menu script, its only float left side. how can i put that center of DIV

I found this script online, but while using this its only float left side. i want this on center of DIV (id="menuback").
tried following but not working...
margin-left:auto;
margin-right:auto;
text-align:center;
ul {
list-style-type:none;
margin:0;
padding:0;
position: absolute;
}
/*Create a horizontal list with spacing*/
li {
display:inline-block;
float: left;
margin-right: 1px;
}
/*Style for menu links*/
li a {
display:block;
min-width:140px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
background: #2f3036;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #19c589;
}
/*Style for dropdown links*/
li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #19c589;
color: #fff;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
/*Display the dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
/*Style 'show menu' label button and hide it by default*/
.show-menu {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-decoration: none;
color: #fff;
background: #19c589;
text-align: center;
padding: 10px 0;
display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
-webkit-appearance: none;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
display: block;
}
/*Responsive Styles*/
#media screen and (max-width : 760px){
/*Make dropdown links appear inline*/
ul {
position: static;
display: none;
}
/*Create vertical spacing*/
li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
ul li, li a {
width: 100%;
}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
}
<div id="menuback" style="text-align:center">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
<ul id="menu">
<li>menu1</li>
<li>
menu2
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
</ul>
</li>
<li>
menu3
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
<li>sub3</li>
</ul>
</li>
<li>menu4</li>
<li>menu5</li>
</ul>
</div>
Give a specific width to your menu e.g 400px and set its margin:0 auto;
add this CSS to ul
ul {
left: 50%;
transform: translate(-50%,0);
}
The thing is that your ul#menu has position: absolute so it don't follow the flow of the document, so remove position: absolute an set display: inline-block
like this:
ul {
list-style-type:none;
margin:0;
padding:0;
/*position: absolute;*/ /*removed*/
display: inline-block; /*added*/
}
/*Create a horizontal list with spacing*/
li {
display:inline-block;
float: left;
margin-right: 1px;
}
/*Style for menu links*/
li a {
display:block;
min-width:140px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
background: #2f3036;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #19c589;
}
/*Style for dropdown links*/
li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #19c589;
color: #fff;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
/*Display the dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
/*Style 'show menu' label button and hide it by default*/
.show-menu {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-decoration: none;
color: #fff;
background: #19c589;
text-align: center;
padding: 10px 0;
display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
-webkit-appearance: none;
}
/*Responsive Styles*/
#media screen and (max-width : 760px){
/*Make dropdown links appear inline*/
ul {
position: static;
display: none;
}
/*Create vertical spacing*/
li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
ul li, li a {
width: 100%;
}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
display: block; /*setting block at low resolution*/
}
}
<div id="menuback" style="text-align:center">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
<ul id="menu">
<li>menu1</li>
<li>
menu2
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
</ul>
</li>
<li>
menu3
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
<li>sub3</li>
</ul>
</li>
<li>menu4</li>
<li>menu5</li>
</ul>
</div>
If you want the menu has position: absolute for some reason add a wrapper that has the position
Like this:
.menu-wrapper{ /*added*/
position: absolute;
width: 100%;
}
ul {
list-style-type:none;
margin:0;
padding:0;
/*position: absolute;*/ /*removed*/
display: inline-block; /*added*/
}
/*Create a horizontal list with spacing*/
li {
display:inline-block;
float: left;
margin-right: 1px;
}
/*Style for menu links*/
li a {
display:block;
min-width:140px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
background: #2f3036;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #19c589;
}
/*Style for dropdown links*/
li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #19c589;
color: #fff;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
/*Display the dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
/*Style 'show menu' label button and hide it by default*/
.show-menu {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-decoration: none;
color: #fff;
background: #19c589;
text-align: center;
padding: 10px 0;
display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
-webkit-appearance: none;
}
/*Responsive Styles*/
#media screen and (max-width : 760px){
/*Make dropdown links appear inline*/
.menu-wrapper {
position: static;
display: none;
}
/*Create vertical spacing*/
li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
ul li, li a {
width: 100%;
}
ul{
display: block;
}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ .menu-wrapper{ /*added the .menu-wrapper selector*/
display: block; /*setting block at low resolution*/
}
}
<div id="menuback" style="text-align:center">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
<div class="menu-wrapper"> <!--added awrapper-->
<ul id="menu">
<li>menu1</li>
<li>
menu2
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
</ul>
</li>
<li>
menu3
<ul class="hidden">
<li>sub1</li>
<li>sub2</li>
<li>sub3</li>
</ul>
</li>
<li>menu4</li>
<li>menu5</li>
</ul>
</div>
</div>

CSS drop down navigation

I'm sure this is something simple I'm missing... My drop down menu is opening within the main navigation, widening it. Here is a link to the page I'm working on. The issue is with the navigation below the App buttons.
http://membershq.incentiveusa.com/AwardPages/GoalUp_Test2/index_test3.html#
Here is my HTML:
<div class="container-fluid">
<div class="section-title2 text-center">
<div class="navigation">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
<ul >
<li>About Us
<ul>
<li>Who We Are</li>
<li>News</li>
</ul></li>
<li>How It Works</li>
<li>Facts</li>
<li>Tools</li>
<li>Testimonials</li>
<li>News</li>
<li>Brand Name Awards</li>
<li>Contact</li>
</ul>
And here is the CSS:
.navigation{
margin-right: auto;
margin-left: auto;
width: 100%;
background-color: #0f9cde;
position: absolute;
display: block;
margin-bottom: 15px;
z-index: 1000;
top: 735px;
margin-left: -15px;
}
/*Strip the ul of padding and list styling*/
.navigation ul{
list-style-type: none;
margin: 0 auto;
padding: 0;
position: relative;
z-index: 10000;
text-align:center;
}
/*Create a horizontal list with spacing*/
.navigation li{
display:inline-block;
margin-right: 0px;
background-color:#0f9bde;
}
/*Style for menu links*/
.navigation li a {
min-width: 189px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: 'Maven Pro', sans-serif;
font-size:18px;
color: #fff;
width:100%;
background-color: #0f9cde;
text-decoration: none;
display:block;
}
/*Hover state for top level links*/
.navigation li:hover a {
color: #f7a800;
text-decoration: underline;
}
/*Style for dropdown links*/
.navigation li:hover ul a {
background: #f7a800;
color: #ffffff;
height: 40px;
line-height: 40px;
z-index: 10001;
}
/*Hover state for dropdown links*/
.navigation li:hover ul a:hover {
background: #fff;
color: #f7a800;
}
/*Hide dropdown links until they are needed*/
.navigation li ul{
display: none;
z-index: 10001;
}
/*Make dropdown links vertical*/
.navigation li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
.navigation li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
.navigation ul li:hover ul{
display:block;
}
/*Display the dropdown on hover*/
navigation ul li a:hover {
display: block;
}
You have to add a position:absolute to the selector .navigation li ul
.navigation{
margin-right: auto;
margin-left: auto;
width: 100%;
background-color: #0f9cde;
position: absolute;
display: block;
margin-bottom: 15px;
z-index: 1000;
margin-left: -15px;
}
/*Strip the ul of padding and list styling*/
.navigation ul{
list-style-type: none;
margin: 0 auto;
padding: 0;
position: relative;
z-index: 10000;
text-align:center;
}
/*Create a horizontal list with spacing*/
.navigation li{
display:inline-block;
margin-right: 0px;
background-color:#0f9bde;
}
/*Style for menu links*/
.navigation li a {
min-width: 189px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: 'Maven Pro', sans-serif;
font-size:18px;
color: #fff;
width:100%;
background-color: #0f9cde;
text-decoration: none;
display:block;
}
/*Hover state for top level links*/
.navigation li:hover a {
color: #f7a800;
text-decoration: underline;
}
/*Style for dropdown links*/
.navigation li:hover ul a {
background: #f7a800;
color: #ffffff;
height: 40px;
line-height: 40px;
z-index: 10001;
}
/*Hover state for dropdown links*/
.navigation li:hover ul a:hover {
background: #fff;
color: #f7a800;
}
/*Hide dropdown links until they are needed*/
.navigation li ul{
display: none;
z-index: 10001;
position: absolute;
}
/*Make dropdown links vertical*/
.navigation li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
.navigation li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
.navigation ul li:hover ul{
display:block;
}
/*Display the dropdown on hover*/
navigation ul li a:hover {
display: block;
}
<div class="container-fluid">
<div class="section-title2 text-center">
<div class="navigation">
<ul >
<li>About Us
<ul>
<li>Who We Are</li>
<li>News</li>
</ul></li>
<li>How It Works</li>
<li>Facts</li>
<li>Tools</li>
<li>Testimonials</li>
<li>News</li>
<li>Brand Name Awards</li>
<li>Contact</li>
</ul>
</div></div></div>

Align Nav bar to right

Hi I have this navbar and wondering how to alight it to the right.
I've tried float:right but doesn't work. Also tried div align but not working
as well. I'm new to css though.
<div align="right">
<ul id="menu">
<li>Home</li>
<li>
About ↓
<ul class="hidden">
<li>Who We Are</li>
<li>What We Do</li>
</ul>
</li>
</ul>
</div>
css
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : 01 27, 15, 9:58:38 AM
Author : jefloresca
*/
/*Strip the ul of padding and list styling*/
ul {
list-style-type:none;
margin:0;
padding:0;
position: absolute;
}
/*Create a horizontal list with spacing*/
li {
display:inline-block;
float: right;
margin-right: 1px;
}
/*Style for menu links*/
li a {
display:block;
min-width:140px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
background: #2f3036;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #19c589;
}
/*Style for dropdown links*/
li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #19c589;
color: #fff;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
/*Display the dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
display: block;
}
/*Responsive Styles*/
#media screen and (max-width : 760px){
/*Make dropdown links appear inline*/
ul {
position: static;
display: none;
}
/*Create vertical spacing*/
li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
ul li, li a {
width: 100%;
}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
}
Here's the link to codepen: http://codepen.io/anon/pen/JoJqMZ
The align="right" attribute is deprecated. Don't use it!
Either remove the absolute positioning on the ul element, and then float the element to the right, or add right: 0.
Updated Example
<div>
<ul id="menu">
<li>Home</li>
<li>
About ↓
<ul class="hidden">
<li>Who We Are</li>
<li>What We Do</li>
</ul>
</li>
</ul>
</div>
ul {
list-style-type: none;
margin: 0;
padding: 0;
float: right;
}
li {
display: inline-block;
float: right;
margin-right: 1px;
}
li a {
display: block;
min-width: 140px;
height: 50px;
text-align: center;
line-height: 50px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
background: #2f3036;
text-decoration: none;
}
li:hover a {
background: #19c589;
}
li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
li:hover ul a:hover {
background: #19c589;
color: #fff;
}
li ul {
display: none;
}
li ul li {
display: block;
float: none;
}
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
ul li a:hover + .hidden, .hidden:hover {
display: block;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox]:checked ~ #menu {
display: block;
}
#media screen and (max-width : 760px) {
ul {
position: static;
display: none;
}
li {
margin-bottom: 1px;
}
ul li, li a {
width: 100%;
}
.show-menu {
display: block;
}
}
Found an answer on my position: relative not absolute
You need to add "width: 100%" in file css.
Code:
ul {
list-style-type:none;
margin:0;
padding:0;
position: absolute;
width: 100%;
}

Drop down menu on hover exceeds container width

I have this drop down menu which is responsive. When media query kicks in and I hover over my links, my drop down menu width sticks out of my container.
<!-- Navigation Menu -->
<div class="container">
<div id="navigation">
<label for="show-menu" class="show-menu">Menu</label>
<input type="checkbox" id="show-menu" role="button">
<ul id="menu">
<li>| Home</li>
<li>
| SERMONS <span>&#x25BC</span>
<ul class="hidden">
<li>Link 1</li>
<li>Link 1</li>
</ul>
</li>
<li>
| EVENTS<span>&#x25BC</span>
<ul class="hidden">
<li>slam Link 1</li>
<li>Link 1</li>
<li>LINK2</li>
</ul>
</li>
<li>| CONNECT<span>&#x25BC</span></li>
<li>| STAFF<span>&#x25BC</span></li>
<li>| LOCATIONS <span>&#x25BC</span></li>
<li>| OTHERS</li>
</ul>
</div>
</div>
<!-- End of Navigation Menu -->
Here is the css:
#navigation {
background-color: #bg-color;
height: 50px;
margin: 0px auto;
}
/*Arrow down style */
#navigation span{
font-size: 10px;
padding-left: 4px;
line-height: 50px;
}
/*Strip the ul of padding and list styling*/
ul {
list-style-type:none;
margin:0;
padding:0;
width: 100%;
position: absolute;
}
/*Create a horizontal list with spacing*/
li {
display:inline-block;
float: left;
margin-right: 1px;
width:100px;
}
/*Style for menu links*/
li a {
display:block;
height: 50px;
text-align: center;
line-height: 50px;
font-family:#Oswald;
font-size: 16px;
color: #fff;
background: #bg-color;
text-decoration: none;
}
/*Hover state for top level links*/
li:hover a {
background: #light-gray;
}
/*Style for dropdown links*/
li:hover ul a {
background: #light-gray;
color: #white;
height: 40px;
line-height: 40px;
width: 100%;
}
/*Hover state for dropdown links*/
li:hover ul a:hover {
background: #bg-color;
color: #white;
}
/*Hide dropdown links until they are needed*/
li ul {
display: none;
position: absolute;
z-index: 100;
}
/*Make dropdown links vertical*/
li ul li {
display: block;
float: none;
}
/*Prevent text wrapping*/
li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
text-align: left;
}
/*Display the dropdown on hover*/
ul li a:hover + .hidden, .hidden:hover {
display: block;
min-width: 100%;
}
/*Style 'show menu' label button and hide it by default*/
.show-menu {
font-family:#Oswald;
text-decoration: none;
color: #fff;
background: #bg-color;
text-align: center;
padding: 10px 0;
display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
display: none;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
display: block;
}
input[type='text']{
color: #bg-color;
}
/*Responsive Styles*/
#media screen and (max-width : 760px){
/*Make dropdown links appear inline*/
ul {
position: static;
display: none;
}
/*Create vertical spacing*/
li {
margin-bottom: 1px;
}
/*Make all menu links full width*/
ul li, li a {
width: 100%;
}
li ul li a {
text-align: center;
}
/*Display 'show menu' link*/
.show-menu {
display:block;
}
.hide-tab {
display: none;
}
#logo h1, #logo p {
text-align: center;
}
#testr form {
float: none;
}
#testr > form > input[type='text'] {
margin: 0 auto;
width:60%;
line-height: 60px;
}
}
I am not sure how to fix it as I have tried everything. A simple width:100% should fix it, but it hasn't.
I don't see where you defined .container