Drop-down menu in CSS appears under page content - css

I have done hours and hours of research on this issue but can't get it to work! I finally got my CSS menu looking exactly how I want it to - yay! But now it drops down under the other content on the page, and I can't figure out how to get it to come up on top. I have adjusted the positioning as many people mentioned, and set the z-index settings all the way up to 2000, with no effect. What am I doing wrong?? Using Firefox - current version.
Here is the CSS code (and no, I don't have a link to show example, as the site isn't published yet)
#cssmenu:before, #cssmenu:after, #cssmenu > ul:before, #cssmenu > ul:after {
content: '';
display: table;
}
#cssmenu:after, #cssmenu > ul:after {
clear: both;
}
#cssmenu
{
zoom: 1;
}
#cssmenu > ul
{
background: #00305f;
margin: 0;
padding: 0;
position: relative;
}
#cssmenu > ul li
{
margin: 0;
padding: 0;
list-style: none;
}
#cssmenu > ul > li
{
float: left;
position: relative;
}
#cssmenu > ul > li > a
{
padding: 20px 25px;
display: block;
color: white;
font-family: Georgia, Times, Serif;
font-size: 20px;
text-transform: capitalize;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(151, 99, 33, .43);
line-height: 18px;
}
#cssmenu > ul > li:hover > a
{
background: #5783af;
}
#cssmenu > ul > li > a > span
{
line-height: 18px;
}
#cssmenu > ul > li.active > a
{
background: #5783af;
}
#cssmenu > ul > li > a:active
{
background: #5783af;
}
#cssmenu > ul ul
{
opacity: 0;
visibility: hidden;
position: absolute;
top: 120px;
background: #00305f;
margin: 0;
padding: 0;
z-index: 2000;
-webkit-transition: all .35s .2s ease-in-out;
-moz-transition: all .35s .2s ease-in-out;
-ms-transition: all .35s .2s ease-in-out;
transition: all .35s .2s ease-in-out;
}
#cssmenu > ul li:hover ul
{
opacity: 1;
visibility: visible;
margin: 0;
color: #5783af;
z-index: 2000;
top: 64px;
left: 0;
}
#cssmenu > ul ul:before
{
content: '';
position: absolute;
top: -10px;
width: 100%;
height: 16px;
background: transparent;
}
#cssmenu > ul ul li
{
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}
#cssmenu > ul ul li a
{
padding: 12px 20px;
display: block;
color: white;
font-family: Georgia, Times, Serif;
font-size: 16px;
text-transform: capitalize;
text-decoration: none;
width: 175px;
border-left: 4px solid transparent;
-webkit-transition: all .35s ease-in-out;
-moz-transition: all .35s ease-in-out;
-ms-transition: all .35s ease-in-out;
transition: all .35s ease-in-out;
text-shadow: 0 -1px 0 rgba(151, 99, 33, .43);
}
#cssmenu > ul ul li a:hover
{
border-left: 4px solid #055988;
background: #5783af;
}
#cssmenu > ul ul li a:active
{
background: #5783af;
}
HTML Code:
<div id='cssmenu'>
<ul>
<li class='has-sub'><a href='home.html'><span>Home</span></a>
<ul>
<li><a href='resources.html'><span>Resources</span></a></li>
<li><a href='products.html'><span>Products</span></a></li>
<li class='last'><a href='contact.html'><span>Contact Us</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='health-wellness.html'><span>Health & Wellness</span></a>
<ul>
<li><a href='cooking-from-scratch.html'><span>Cooking From Scratch</span></a></li>
<li><a href='sustainable-gardening.html'><span>Sustainable Gardening</span></a></li>
<li><a href='csa.html'><span>Community Supported Agriculture</span></a></li>
<li><a href='fun-ways-to-exercise.html'><span>Fun Ways to Exercise</span></a></li>
<li><a href='pain-relief.html'><span>Natural Relief for Chronic Pain</span></a></li>
<li class='last'><a href='toxic-load.html'><span>Reducing Your Toxic
Load</span></a></li>
</ul>
</li>
<li><a href='relationships.html'><span>Relationships</span></a></li>
<li><a href='wealth.html'><span>Wealth</span></a></li>
<li class='last'><a href='spirituality.html'><span>Spirituality</span></a></li>
</ul>
</div>

Try with :
#cssmenu
{
zoom: 1;
z-index:9999 !important;
}

Related

how to use vertical menu using asp.net

In my master page (his name is menu.master) , i want to create 3 menu , the first (title) , the second (example2) and the footer (copyright )
my question is : how to make (
here is my code in masterpage
<form id="form1" runat="server">
<div class="title" style="background-color:red";>
Home
<asp:label id="Label2" Text="Bienvenue" runat="server"></asp:label>
<asp:label id="Label3" Text="Exit" runat="server"></asp:label>
</div>
<div class="example2" style="background-color:green;position:fixed;">
Contacter <br /><br />
<asp:Label ID="test" Text="Test" runat="server"></asp:Label>
</div>
<asp:ContentPlaceHolder ID="barreMenu" runat="server">
</asp:ContentPlaceHolder>
<div class="footer" style="position:fixed;background-color:yellow;width:100%;bottom:0;">
<h3>...........</h3>
</div>
</form>
</body>
Copy And Paste and name it as Menu.css
#cssmenu {
position: relative;
background:#DCDCDC;
width:100%;
}
#cssmenu ul {
list-style: none;
padding: 0;
margin: 0;
line-height: 1;
}
#cssmenu > ul {
position: relative;
display: block;
background:Skyblue;
width: 100%;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-center ul {
text-align: center;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li {
display: inline-block;
position: relative;
margin: 0;
padding: 0;
}
#cssmenu > ul > #menu-button {
display: none;
}
#cssmenu ul li a {
display: block;
font-family:Times New Roman;
text-decoration: none;
}
#cssmenu > ul > li > a {
font-size: 16px;
font-weight: bold;
padding: 15px 10px;
color: Black;
text-transform: uppercase;
-webkit-transition: color 0.25s ease-out;
-moz-transition: color 0.25s ease-out;
-ms-transition: color 0.25s ease-out;
-o-transition: color 0.25s ease-out;
transition: color 0.25s ease-out;
}
#cssmenu > ul > li.has-sub > a {
padding-right: 32px;
}
#cssmenu > ul > li:hover > a {
color: #ffffff;
}
#cssmenu li.has-sub::after {
display: block;
content: "";
position: absolute;
width: 0;
height: 0;
}
#cssmenu > ul > li.has-sub::after {
right: 10px;
top: 20px;
border: 5px solid transparent;
border-top-color: #7a8189;
}
#cssmenu > ul > li:hover::after {
border-top-color: #ffffff;
}
#indicatorContainer {
position: absolute;
height: 12px;
width: 100%;
bottom: 0px;
overflow: hidden;
z-index: -1;
}
#pIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #2b2f3a;
z-index: -2;
-webkit-transition: left .25s ease;
-moz-transition: left .25s ease;
-ms-transition: left .25s ease;
-o-transition: left .25s ease;
transition: left .25s ease;
}
#cIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #2b2f3a;
top: -12px;
right: 100%;
z-index: -2;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 70px;
opacity: 0;
-webkit-transition: opacity .3s ease, top .25s ease;
-moz-transition: opacity .3s ease, top .25s ease;
-ms-transition: opacity .3s ease, top .25s ease;
-o-transition: opacity .3s ease, top .25s ease;
transition: opacity .3s ease, top .25s ease;
z-index: 1000;
}
#cssmenu ul ul ul {
top: 37px;
padding-left: 5px;
}
#cssmenu ul ul li {
position: relative;
}
#cssmenu > ul > li:hover > ul {
left: auto;
top: 44px;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
opacity: 1;
}
#cssmenu ul ul li:hover > ul {
left: 170px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul li:hover > ul {
left: auto;
right: 170px;
top: 0;
opacity: 1;
padding-right: 5px;
}
#cssmenu ul ul li a {
width: 130px;
border-bottom: 0.5px solid #eeeeee;
padding: 10px 20px;
font-size: 14px;
color: Black;
background:#DCDCDC;
-webkit-transition: all .35s ease;
-moz-transition: all .35s ease;
-ms-transition: all .35s ease;
-o-transition: all .35s ease;
transition: all .35s ease;
}
#cssmenu.align-right ul ul li a {
text-align: right;
}
#cssmenu ul ul li:hover > a {
background: #f2f2f2;
color: #8c9195;
}
#cssmenu ul ul li:last-child > a,
#cssmenu ul ul li.last > a {
border-bottom: 0;
}
#cssmenu > ul > li > ul::after {
content: '';
border: 6px solid transparent;
width: 0;
height: 0;
border-bottom-color: #ffffff;
position: absolute;
top: -12px;
left: 30px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 30px;
}
#cssmenu ul ul li.has-sub::after {
border: 4px solid transparent;
border-left-color: #9ea2a5;
right: 10px;
top: 12px;
-moz-transition: all .2s ease;
-ms-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
-webkit-transition: -webkit-transform 0.2s ease, right 0.2s ease;
}
#cssmenu.align-right ul ul li.has-sub::after {
border-left-color: transparent;
border-right-color: #9ea2a5;
right: auto;
left: 10px;
}
#cssmenu ul ul li.has-sub:hover::after {
border-left-color: #ffffff;
right: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#cssmenu.align-right ul ul li.has-sub:hover::after {
border-right-color: #ffffff;
border-left-color: transparent;
left: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#cssmenu {
width: auto;
}
#cssmenu.align-center ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: none;
}
#cssmenu ul {
width: auto;
}
#cssmenu .submenuArrow,
#cssmenu #indicatorContainer {
display: none;
}
#cssmenu > ul {
height: auto;
display: block;
}
#cssmenu > ul > li {
float: none;
}
#cssmenu li,
#cssmenu > ul > li {
display: none;
}
#cssmenu ul ul,
#cssmenu ul ul ul,
#cssmenu ul > li:hover > ul,
#cssmenu ul ul > li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul > li:hover > ul,
#cssmenu.align-right ul ul > li:hover > ul {
position: relative;
left: auto;
top: auto;
opacity: 1;
padding-left: 0;
padding-right: 0;
right: auto;
}
#cssmenu ul .has-sub::after {
display: none;
}
#cssmenu ul li a {
padding: 12px 20px;
}
#cssmenu ul ul li a {
border: 0;
background: none;
width: auto;
padding: 8px 35px;
}
#cssmenu.align-right ul ul li a {
text-align: left;
}
#cssmenu ul ul li:hover > a {
background: none;
color: #8c9195;
}
#cssmenu ul ul ul a {
padding: 8px 50px;
}
#cssmenu ul ul ul ul a {
padding: 8px 65px;
}
#cssmenu ul ul ul ul ul a {
padding: 8px 80px;
}
#cssmenu ul ul ul ul ul ul a {
padding: 8px 95px;
}
#cssmenu > ul > #menu-button {
display: block;
cursor: pointer;
}
#cssmenu #menu-button > a {
padding: 12px 20px;
}
#cssmenu ul.open li,
#cssmenu > ul.open > li {
display: block;
}
#cssmenu > ul.open > li#menu-button > a {
color: #fff;
border-bottom: 0.5px solid rgba(150, 150, 150, 0.1);
}
#cssmenu ul ul::after {
display: none;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 0px solid #7a8189;
border-bottom: 0px solid #7a8189;
right: 20px;
top: 15px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 0px solid #7a8189;
right: 20px;
top: 25px;
}
#cssmenu ul.open #menu-button::after,
#cssmenu ul.open #menu-button::before {
border-color: #fff;
}
}
In form
<table width="100%">
<td style="width: 200px" valign="top">
<div id="cssmenu">
<ul id="">
<li><span>Admin</span>
<ul>
<li>Test1</li>
</ul>
</li>
<li><span>Master</span>
<ul>
<li>test2</li>
</ul>
</li>
<li class="dropdown"><span>test</span>
<ul>
<li>Test2
<ul>
<li>Test2-test
</ul>
</li>
</ul>
</li>
</ul>
</div>
</td>
</table>
Use For Has Sub else Avoid
<script>
(function($) {
$(document).ready(function() {
$('#cssmenu').prepend('<div id="indicatorContainer"><div id="pIndicator"><div id="cIndicator"></div></div></div>');
var activeElement = $('#cssmenu>ul>li:first');
$('#cssmenu>ul>li').each(function() {
if ($(this).hasClass('active')) {
activeElement = $(this);
}
});
var posLeft = activeElement.position().left;
var elementWidth = activeElement.width();
posLeft = posLeft + elementWidth / 2 - 6;
if (activeElement.hasClass('has-sub')) {
posLeft -= 6;
}
$('#cssmenu #pIndicator').css('left', posLeft);
var element, leftPos, indicator = $('#cssmenu pIndicator');
$("#cssmenu>ul>li").hover(function() {
element = $(this);
var w = element.width();
if ($(this).hasClass('has-sub')) {
leftPos = element.position().left + w / 2 - 12;
}
else {
leftPos = element.position().left + w / 2 - 6;
}
$('#cssmenu #pIndicator').css('left', leftPos);
}
, function() {
$('#cssmenu #pIndicator').css('left', posLeft);
});
$('#cssmenu>ul').prepend('<li id="menu-button"><a>Menu</a></li>');
$("#menu-button").click(function() {
if ($(this).parent().hasClass('open')) {
$(this).parent().removeClass('open');
}
else {
$(this).parent().addClass('open');
}
});
});
})(jQuery);
</script>
Use Your Own Footer...

How can I change the underline colour with the transition element in use? (CSS)

On my website, I have used a template to make my navigation bar. My goal is to customise it so that it looks like the BBC navigation bar. (Link:
http://www.bbc.co.uk) Is there any way I can change the border bottom/ underline colour with the transition element in use? And if so, can you please modify the code so that it acts like the BBC menu bar.
Thanks! :D
Code:
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Open Sans;
}
#cssmenu {
background: #f96e5b;
width: auto;
}
#cssmenu ul {
list-style: none;
margin: 0;
padding: 0;
line-height: 1;
display: block;
zoom: 1;
}
#cssmenu ul:after {
content: " ";
display: block;
font-size: 0;
height: 0;
clear: both;
visibility: hidden;
}
#cssmenu ul li {
display: inline-block;
padding: 0;
margin: 0;
}
#cssmenu.align-right ul li {
float: right;
}
#cssmenu.align-center ul {
text-align: center;
}
#cssmenu ul li a {
color: #ffffff;
text-decoration: none;
display: block;
padding: 15px 25px;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
text-transform: uppercase;
font-size: 14px;
position: relative;
-webkit-transition: color .25s;
-moz-transition: color .25s;
-ms-transition: color .25s;
-o-transition: color .25s;
transition: color .25s;
}
#cssmenu ul li a:hover {
color: #00ff00;
}
#cssmenu ul li a:hover:before {
width: 100%;
}
#cssmenu ul li a:after {
content: "";
display: block;
position: absolute;
right: -3px;
top: 19px;
height: 6px;
width: 6px;
background: #ffffff;
opacity: .5;
}
#cssmenu ul li a:before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 0;
background: #333333;
-webkit-transition: width .25s;
-moz-transition: width .25s;
-ms-transition: width .25s;
-o-transition: width .25s;
transition: width .25s;
}
#cssmenu ul li.last > a:after,
#cssmenu ul li:last-child > a:after {
display: none;
}
#cssmenu ul li.active a {
color: #333333;
}
#cssmenu ul li.active a:before {
width: 100%;
}
#cssmenu.align-right li.last > a:after,
#cssmenu.align-right li:last-child > a:after {
display: block;
}
#cssmenu.align-right li:first-child a:after {
display: none;
}
#media screen and (max-width: 768px) {
#cssmenu ul li {
float: none;
display: block;
}
#cssmenu ul li a {
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 1px solid #fb998c;
}
#cssmenu ul li.last > a,
#cssmenu ul li:last-child > a {
border: 0;
}
#cssmenu ul li a:after {
display: none;
}
#cssmenu ul li a:before {
display: none;
}
}
.dateOfPost {
font-weight: bold;
text-decoration: underline;
}
</style>
<script>
</script>
<title>Ryan Zhang's Blog</title>
</head>
<body>
<h1>
Ryan Zhang's Blog
</h1>
<div id='cssmenu'>
<ul>
<li class="active">
<span>Home</span>
</li>
<li>
<span>About Me</span>
</li>
<li>
<span>Tips 'n' Tricks</span>
</li>
<li>
<span>Inspirational Quotes and Words</span>
</li>
<li>
<span>Timeline of Me</span>
</li>
<li>
<span>Contact</span>
</li>
</ul>
</div>
<hr>
<p class="dateOfPost">
Website Goes Live!<br>
Upload Date:<br>
25/10/15
</p>
<p class="posts">
Wooh! The website is live now!<br>
Stick around for:<br>
Kind Words,<br>
Interesting Posts,<br>
Helpful Articles<br>
And Cool Facts!<br>
<br>
-Ryan
</p>
<hr>
</body>
</html>
CSS Navigation Bar Code:
#cssmenu {
background: #f96e5b;
width: auto;
}
#cssmenu ul {
list-style: none;
margin: 0;
padding: 0;
line-height: 1;
display: block;
zoom: 1;
}
#cssmenu ul:after {
content: " ";
display: block;
font-size: 0;
height: 0;
clear: both;
visibility: hidden;
}
#cssmenu ul li {
display: inline-block;
padding: 0;
margin: 0;
}
#cssmenu.align-right ul li {
float: right;
}
#cssmenu.align-center ul {
text-align: center;
}
#cssmenu ul li a {
color: #ffffff;
text-decoration: none;
display: block;
padding: 15px 25px;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
text-transform: uppercase;
font-size: 14px;
position: relative;
-webkit-transition: color .25s;
-moz-transition: color .25s;
-ms-transition: color .25s;
-o-transition: color .25s;
transition: color .25s;
}
#cssmenu ul li a:hover {
color: #00ff00;
}
#cssmenu ul li a:hover:before {
width: 100%;
}
#cssmenu ul li a:after {
content: "";
display: block;
position: absolute;
right: -3px;
top: 19px;
height: 6px;
width: 6px;
background: #ffffff;
opacity: .5;
}
#cssmenu ul li a:before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 0;
background: #333333;
-webkit-transition: width .25s;
-moz-transition: width .25s;
-ms-transition: width .25s;
-o-transition: width .25s;
transition: width .25s;
}
#cssmenu ul li.last > a:after,
#cssmenu ul li:last-child > a:after {
display: none;
}
#cssmenu ul li.active a {
color: #333333;
}
#cssmenu ul li.active a:before {
width: 100%;
}
#cssmenu.align-right li.last > a:after,
#cssmenu.align-right li:last-child > a:after {
display: block;
}
#cssmenu.align-right li:first-child a:after {
display: none;
}
#media screen and (max-width: 768px) {
#cssmenu ul li {
float: none;
display: block;
}
#cssmenu ul li a {
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 1px solid #fb998c;
}
#cssmenu ul li.last > a,
#cssmenu ul li:last-child > a {
border: 0;
}
#cssmenu ul li a:after {
display: none;
}
#cssmenu ul li a:before {
display: none;
}
}
They give each li its own class.
The easiest was to do this would be to give every li a border-bottom that matches the background color.
Then on hover, just change the border-color property for that specific li.
Like this:
<ul>
<li class="one">Lorem</li>
<li class="two">Lorem</li>
<li class="three">Lorem</li>
<li class="four">Lorem</li>
<li class="five">Lorem</li>
<li class="six">Lorem</li>
</ul>
li{
border-bottom: 5px solid transparent;
}
.one:hover{border-color: dodgerblue;}
.two:hover{border-color: seagreen;}
.three:hover{border-color: skyblue;}
.four:hover{border-color: tomato;}
.five:hover{border-color: grey;}
.six:hover{border-color: white;}
http://codepen.io/LukeD1uk/pen/EVRvjY
Have you thought about applying them the property border-bottom : Xpx solid #yourColor ?
I don't really see what you mean otherwise make a screenshot :)

css working differently depends on window size

I would like to have the display for maximized window as shown when browser is minimized. However it does not work it is supposed to be. I hope any of who can help me. Please.
This are the pictures.
Maximized picture : http://imgur.com/qdAKJiJ
Minimized picture : http://imgur.com/MRdiGPm
I hope you can understand my question. I want my middle part of this web in white color even when the browser is full page as shown it is minimized.
Please help me, really need help.
body {
font: 100% Lucida Sans;
margin: 50px;
width: 1200px;
line-height: 26px;
background-image: url("pink ribbon simple.jpg");
background-size: auto;
background-repeat: no-repeat
}
.main {
position: relative;
padding: 0px;
}
/**************************WELCOME*******************************/
#video { background-color: #f1f1f1;
width: 800px ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px; }
#option div { background: #f1f1f1;
color: black;
padding: 15px;
width: 300px;
margin: 5px; }
.opt { text-align: center; }
.opt div { display: inline-block;
text-align: center; }
/**************************BUTTON*******************************/
.button
{
display: inline-block;
margin-top: 2em;
padding: 0.8em 2em;
background: #8B317D;
line-height: 1.8em;
letter-spacing: 1px;
text-decoration: none;
font-size: 1em;
color: #FFF;
}
.button:before
{
display: inline-block;
background: #ccc;
margin-right: 1em;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 20px;
text-align: center;
color: #272925;
}
.button-small
{
}
/**************************HEADER*******************************/
#header {
border: 8px solid #993366;
background-color: #f1f1f1;
padding: 15px;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 35px;
margin-left: 0px;
position: relative;
text-align: center;
text-color: #993366;
}
/**************************SIGN UP*******************************/
#signUp {
background-color: #f1f1f1;
width: 60% ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px;
}
/**************************LOGIN*******************************/
#login {
background-color: #f1f1f1;
width: 60% ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px;
}
/**************************MENU*******************************/
#cssmenu {
position: relative;
height: 44px;
background: #993366;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 35px;
margin-left: 0px;
}
#cssmenu ul {
list-style: none;
padding: 0;
margin: 0;
line-height: 1;
}
#cssmenu > ul {
position: relative;
display: block;
background: #993366;
width: 100%;
z-index: 500;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-center ul {
text-align: center;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li {
display: inline-block;
position: relative;
margin: 0;
padding: 0;
}
#cssmenu > ul > #menu-button {
display: none;
}
#cssmenu ul li a {
display: block;
font-family: Helvetica, sans-serif;
text-decoration: none;
}
#cssmenu > ul > li > a {
font-size: 14px;
font-weight: bold;
padding: 15px 20px;
color: #fff;
text-transform: uppercase;
-webkit-transition: color 0.25s ease-out;
-moz-transition: color 0.25s ease-out;
-ms-transition: color 0.25s ease-out;
-o-transition: color 0.25s ease-out;
transition: color 0.25s ease-out;
}
#cssmenu > ul > li.has-sub > a {
padding-right: 32px;
}
#cssmenu > ul > li:hover > a {
color: #ffffff;
}
#cssmenu li.has-sub::after {
display: block;
content: "";
position: absolute;
width: 0;
height: 0;
}
#cssmenu > ul > li.has-sub::after {
right: 10px;
top: 20px;
border: 5px solid transparent;
border-top-color: #993366;
}
#cssmenu > ul > li:hover::after {
border-top-color: #ffffff;
}
#indicatorContainer {
position: absolute;
height: 12px;
width: 100%;
bottom: 0px;
overflow: hidden;
z-index: -1;
}
#pIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #993366;
z-index: -2;
-webkit-transition: left .25s ease;
-moz-transition: left .25s ease;
-ms-transition: left .25s ease;
-o-transition: left .25s ease;
transition: left .25s ease;
}
#cIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #993366;
top: -12px;
right: 100%;
z-index: -2;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 70px;
opacity: 0;
-webkit-transition: opacity .3s ease, top .25s ease;
-moz-transition: opacity .3s ease, top .25s ease;
-ms-transition: opacity .3s ease, top .25s ease;
-o-transition: opacity .3s ease, top .25s ease;
transition: opacity .3s ease, top .25s ease;
z-index: 1000;
}
#cssmenu ul ul ul {
top: 37px;
padding-left: 5px;
}
#cssmenu ul ul li {
position: relative;
}
#cssmenu > ul > li:hover > ul {
left: auto;
top: 44px;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
opacity: 1;
}
#cssmenu ul ul li:hover > ul {
left: 170px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul li:hover > ul {
left: auto;
right: 170px;
top: 0;
opacity: 1;
padding-right: 5px;
}
#cssmenu ul ul li a {
width: 130px;
border-bottom: 1px solid #eeeeee;
padding: 10px 20px;
font-size: 12px;
color: #993366;
background: #ffffff;
-webkit-transition: all .35s ease;
-moz-transition: all .35s ease;
-ms-transition: all .35s ease;
-o-transition: all .35s ease;
transition: all .35s ease;
}
#cssmenu.align-right ul ul li a {
text-align: right;
}
#cssmenu ul ul li:hover > a {
background: #f2f2f2;
color: #8c9195;
}
#cssmenu ul ul li:last-child > a,
#cssmenu ul ul li.last > a {
border-bottom: 0;
}
#cssmenu > ul > li > ul::after {
content: '';
border: 6px solid transparent;
width: 0;
height: 0;
border-bottom-color: #993366;
position: absolute;
top: -12px;
left: 30px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 30px;
}
#cssmenu ul ul li.has-sub::after {
border: 4px solid transparent;
border-left-color: #993366;
right: 10px;
top: 12px;
-moz-transition: all .2s ease;
-ms-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
-webkit-transition: -webkit-transform 0.2s ease, right 0.2s ease;
}
#cssmenu.align-right ul ul li.has-sub::after {
border-left-color: transparent;
border-right-color: #993366;
right: auto;
left: 10px;
}
#cssmenu ul ul li.has-sub:hover::after {
border-left-color: #ffffff;
right: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#cssmenu.align-right ul ul li.has-sub:hover::after {
border-right-color: #ffffff;
border-left-color: transparent;
left: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#cssmenu {
width: auto;
}
#cssmenu.align-center ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: none;
}
#cssmenu ul {
width: auto;
}
#cssmenu .submenuArrow,
#cssmenu #indicatorContainer {
display: none;
}
#cssmenu > ul {
height: auto;
display: block;
}
#cssmenu > ul > li {
float: none;
}
#cssmenu li,
#cssmenu > ul > li {
display: none;
}
#cssmenu ul ul,
#cssmenu ul ul ul,
#cssmenu ul > li:hover > ul,
#cssmenu ul ul > li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul > li:hover > ul,
#cssmenu.align-right ul ul > li:hover > ul {
position: relative;
left: auto;
top: auto;
opacity: 1;
padding-left: 0;
padding-right: 0;
right: auto;
}
#cssmenu ul .has-sub::after {
display: none;
}
#cssmenu ul li a {
padding: 12px 20px;
}
#cssmenu ul ul li a {
border: 0;
background: none;
width: auto;
padding: 8px 35px;
}
#cssmenu.align-right ul ul li a {
text-align: left;
}
#cssmenu ul ul li:hover > a {
background: none;
color: #8c9195;
}
#cssmenu ul ul ul a {
padding: 8px 50px;
}
#cssmenu ul ul ul ul a {
padding: 8px 65px;
}
#cssmenu ul ul ul ul ul a {
padding: 8px 80px;
}
#cssmenu ul ul ul ul ul ul a {
padding: 8px 95px;
}
#cssmenu > ul > #menu-button {
display: block;
cursor: pointer;
}
#cssmenu #menu-button > a {
padding: 14px 20px;
}
#cssmenu ul.open li,
#cssmenu > ul.open > li {
display: block;
}
#cssmenu > ul.open > li#menu-button > a {
color: #fff;
border-bottom: 1px solid rgba(150, 150, 150, 0.1);
}
#cssmenu ul ul::after {
display: none;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #7a8189;
border-bottom: 2px solid #7a8189;
right: 20px;
top: 15px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #7a8189;
right: 20px;
top: 25px;
}
#cssmenu ul.open #menu-button::after,
#cssmenu ul.open #menu-button::before {
border-color: #fff;
}
/**************************FORM*******************************/
form {
display: inline-block;
text-align: center;
}
#button {
align: right
border: 8px solid #993366;
}
/**************************MIDDLE*******************************/
.middle {
width: 100%;
position: relative;
margin: 0 auto;
background-color: white;
}
.middle:after {
display: table;
clear: both;
content: '';
}
.container {
width: 100%;
float: left;
overflow: hidden;
background-color: #FF99CC;
}
.content {
padding: 10 320px 0 0;
}
/**************************AWARENESS*******************************/
#awareness {
background-color: #FFF;
width: 60% ;
margin:0 40px;
text-align: center;
padding: 50px;
border-style: solid;
border-color: #993366;
border-width: 8px;
}
#awareness p {
text-align: left;
}
#awareness h3 {
color: #198D83;
text-align: left;
}
/**************************FOOTER*******************************/
.footer {
border: 8px solid #993366;
background-color: #f1f1f1;
text-align: center;
padding: 5px;
margin: 10px 0px 0px 0px;
font-size: 70%;
line-height: 10px;
}
p.explanation { text-align: left; }
#header h1 { color: #E20765; }
#signUp h2, #header h1, #header p { text-align: center; }
#header h1,{ margin: 0;
padding: 0; }
<?php
include 'protectedPage.php';
?>
<html>
<head>
<meta charset="ISO-8859-1">
<link rel="stylesheet" href="regLog.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>
<title>PINK RIBBON</title>
<body>
<div class="main">
<div id="header">
<h1>JOIN OUR COMMUNITY NOW</h1>
<p>PINK RIBBON COMMUNITY PAGE</p>
</div>
<div id='cssmenu'>
<ul>
<li><a href='main.php'><span>Home</span></a></li>
<li class='active has-sub'><a href='#'><span>Assesment Tests</span></a>
<ul>
<li class='last'><a href='#'><span>Risk Assesment Test</span></a></li>
<li class='last'><a href='#'><span>Symptom Test</span></a></li>
<li class='last'><a href='#'><span>Stage Test</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='awareness.php'><span>The Awareness</span></a>
<ul>
<li class='last'><a href='#'><span>About Breast Cancer</span></a></li>
<li class='last'><a href='#'><span>Breast Self Examination</span></a></li>
<li class='last'><a href='#'><span>Symptoms</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Types and Treatment</span></a>
<ul>
<li class='last'><a href='#'><span>Type of Treatment</span></a></li>
<li class='last'><a href='#'><span>Recovery Process</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Lifestyle</span></a>
<ul>
<li class='last'><a href='#'><span>Eat Healthy</span></a></li>
<li class='last'><a href='#'><span>Get Active</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Coping With Cancer</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Join and Share</span></a>
<ul>
<li><a href='#'><span>List of Forum</span></a></li>
<li class='last'><a href='#'><span>Cancer Survivor</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>What Should Us Do</span></a>
<ul>
<li><a href='#'><span>Self Support</span></a></li>
<li><a href='#'><span>Family Support</span></a></li>
<li class='last'><a href='#'><span>Public Support</span></a></li>
</ul>
</li>
</ul>
</li>
<li class='last'><a href='#'><span>Contact Us</span></a></li>
</ul>
</div>
</div>
<br><br>
<div class="middle">
<div class="container">
<main class="content">
<div id="forum">
hi!<?php echo $loginSession;?> <b id="logout">Log Out</b>
<p>Forum is bla bla bla bla</p>
<br><br>
<h2>JOIN FORUM</h2>
<br>
<h3>Share your experience of coping with cancer</h3>
<p>Alex said: <b>We need to be patient</b></p>
</div>
</main>
</div>
</div>
<div class="footer">
<strong>COPYRIGHT OF PINK RIBBON INFO4999 SECTION 1</strong>
</div>
</body>
</head>
</html>
Your screen shots show a different effect from the code snippet in your question: in the snippet, the main block becomes pink when you make the window narrower instead of white.
So I'm not sure if the webpage has the same code as the snippet, but to solve the problem in the snippet, you need an extra } to close the media query.
Judging by the indentation, the missing } should be inserted in line 469 of the css.
Solved snippet:
body {
font: 100% Lucida Sans;
margin: 50px;
width: 1200px;
line-height: 26px;
background-image: url("pink ribbon simple.jpg");
background-size: auto;
background-repeat: no-repeat
}
.main {
position: relative;
padding: 0px;
}
/**************************WELCOME*******************************/
#video { background-color: #f1f1f1;
width: 800px ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px; }
#option div { background: #f1f1f1;
color: black;
padding: 15px;
width: 300px;
margin: 5px; }
.opt { text-align: center; }
.opt div { display: inline-block;
text-align: center; }
/**************************BUTTON*******************************/
.button
{
display: inline-block;
margin-top: 2em;
padding: 0.8em 2em;
background: #8B317D;
line-height: 1.8em;
letter-spacing: 1px;
text-decoration: none;
font-size: 1em;
color: #FFF;
}
.button:before
{
display: inline-block;
background: #ccc;
margin-right: 1em;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 20px;
text-align: center;
color: #272925;
}
.button-small
{
}
/**************************HEADER*******************************/
#header {
border: 8px solid #993366;
background-color: #f1f1f1;
padding: 15px;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 35px;
margin-left: 0px;
position: relative;
text-align: center;
text-color: #993366;
}
/**************************SIGN UP*******************************/
#signUp {
background-color: #f1f1f1;
width: 60% ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px;
}
/**************************LOGIN*******************************/
#login {
background-color: #f1f1f1;
width: 60% ;
margin:0 auto;
text-align: center;
padding: 50px;
border-style: outset;
border-color: #993366;
border-width: 8px;
}
/**************************MENU*******************************/
#cssmenu {
position: relative;
height: 44px;
background: #993366;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 35px;
margin-left: 0px;
}
#cssmenu ul {
list-style: none;
padding: 0;
margin: 0;
line-height: 1;
}
#cssmenu > ul {
position: relative;
display: block;
background: #993366;
width: 100%;
z-index: 500;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-center ul {
text-align: center;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li {
display: inline-block;
position: relative;
margin: 0;
padding: 0;
}
#cssmenu > ul > #menu-button {
display: none;
}
#cssmenu ul li a {
display: block;
font-family: Helvetica, sans-serif;
text-decoration: none;
}
#cssmenu > ul > li > a {
font-size: 14px;
font-weight: bold;
padding: 15px 20px;
color: #fff;
text-transform: uppercase;
-webkit-transition: color 0.25s ease-out;
-moz-transition: color 0.25s ease-out;
-ms-transition: color 0.25s ease-out;
-o-transition: color 0.25s ease-out;
transition: color 0.25s ease-out;
}
#cssmenu > ul > li.has-sub > a {
padding-right: 32px;
}
#cssmenu > ul > li:hover > a {
color: #ffffff;
}
#cssmenu li.has-sub::after {
display: block;
content: "";
position: absolute;
width: 0;
height: 0;
}
#cssmenu > ul > li.has-sub::after {
right: 10px;
top: 20px;
border: 5px solid transparent;
border-top-color: #993366;
}
#cssmenu > ul > li:hover::after {
border-top-color: #ffffff;
}
#indicatorContainer {
position: absolute;
height: 12px;
width: 100%;
bottom: 0px;
overflow: hidden;
z-index: -1;
}
#pIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #993366;
z-index: -2;
-webkit-transition: left .25s ease;
-moz-transition: left .25s ease;
-ms-transition: left .25s ease;
-o-transition: left .25s ease;
transition: left .25s ease;
}
#cIndicator {
position: absolute;
height: 0;
width: 100%;
border: 12px solid transparent;
border-top-color: #993366;
top: -12px;
right: 100%;
z-index: -2;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 70px;
opacity: 0;
-webkit-transition: opacity .3s ease, top .25s ease;
-moz-transition: opacity .3s ease, top .25s ease;
-ms-transition: opacity .3s ease, top .25s ease;
-o-transition: opacity .3s ease, top .25s ease;
transition: opacity .3s ease, top .25s ease;
z-index: 1000;
}
#cssmenu ul ul ul {
top: 37px;
padding-left: 5px;
}
#cssmenu ul ul li {
position: relative;
}
#cssmenu > ul > li:hover > ul {
left: auto;
top: 44px;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
opacity: 1;
}
#cssmenu ul ul li:hover > ul {
left: 170px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul li:hover > ul {
left: auto;
right: 170px;
top: 0;
opacity: 1;
padding-right: 5px;
}
#cssmenu ul ul li a {
width: 130px;
border-bottom: 1px solid #eeeeee;
padding: 10px 20px;
font-size: 12px;
color: #993366;
background: #ffffff;
-webkit-transition: all .35s ease;
-moz-transition: all .35s ease;
-ms-transition: all .35s ease;
-o-transition: all .35s ease;
transition: all .35s ease;
}
#cssmenu.align-right ul ul li a {
text-align: right;
}
#cssmenu ul ul li:hover > a {
background: #f2f2f2;
color: #8c9195;
}
#cssmenu ul ul li:last-child > a,
#cssmenu ul ul li.last > a {
border-bottom: 0;
}
#cssmenu > ul > li > ul::after {
content: '';
border: 6px solid transparent;
width: 0;
height: 0;
border-bottom-color: #993366;
position: absolute;
top: -12px;
left: 30px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 30px;
}
#cssmenu ul ul li.has-sub::after {
border: 4px solid transparent;
border-left-color: #993366;
right: 10px;
top: 12px;
-moz-transition: all .2s ease;
-ms-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
-webkit-transition: -webkit-transform 0.2s ease, right 0.2s ease;
}
#cssmenu.align-right ul ul li.has-sub::after {
border-left-color: transparent;
border-right-color: #993366;
right: auto;
left: 10px;
}
#cssmenu ul ul li.has-sub:hover::after {
border-left-color: #ffffff;
right: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#cssmenu.align-right ul ul li.has-sub:hover::after {
border-right-color: #ffffff;
border-left-color: transparent;
left: -5px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#cssmenu {
width: auto;
}
#cssmenu.align-center ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: none;
}
#cssmenu ul {
width: auto;
}
#cssmenu .submenuArrow,
#cssmenu #indicatorContainer {
display: none;
}
#cssmenu > ul {
height: auto;
display: block;
}
#cssmenu > ul > li {
float: none;
}
#cssmenu li,
#cssmenu > ul > li {
display: none;
}
#cssmenu ul ul,
#cssmenu ul ul ul,
#cssmenu ul > li:hover > ul,
#cssmenu ul ul > li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul > li:hover > ul,
#cssmenu.align-right ul ul > li:hover > ul {
position: relative;
left: auto;
top: auto;
opacity: 1;
padding-left: 0;
padding-right: 0;
right: auto;
}
#cssmenu ul .has-sub::after {
display: none;
}
#cssmenu ul li a {
padding: 12px 20px;
}
#cssmenu ul ul li a {
border: 0;
background: none;
width: auto;
padding: 8px 35px;
}
#cssmenu.align-right ul ul li a {
text-align: left;
}
#cssmenu ul ul li:hover > a {
background: none;
color: #8c9195;
}
#cssmenu ul ul ul a {
padding: 8px 50px;
}
#cssmenu ul ul ul ul a {
padding: 8px 65px;
}
#cssmenu ul ul ul ul ul a {
padding: 8px 80px;
}
#cssmenu ul ul ul ul ul ul a {
padding: 8px 95px;
}
#cssmenu > ul > #menu-button {
display: block;
cursor: pointer;
}
#cssmenu #menu-button > a {
padding: 14px 20px;
}
#cssmenu ul.open li,
#cssmenu > ul.open > li {
display: block;
}
#cssmenu > ul.open > li#menu-button > a {
color: #fff;
border-bottom: 1px solid rgba(150, 150, 150, 0.1);
}
#cssmenu ul ul::after {
display: none;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #7a8189;
border-bottom: 2px solid #7a8189;
right: 20px;
top: 15px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #7a8189;
right: 20px;
top: 25px;
}
#cssmenu ul.open #menu-button::after,
#cssmenu ul.open #menu-button::before {
border-color: #fff;
}
}
/**************************FORM*******************************/
form {
display: inline-block;
text-align: center;
}
#button {
align: right
border: 8px solid #993366;
}
/**************************MIDDLE*******************************/
.middle {
width: 100%;
position: relative;
margin: 0 auto;
background-color: white;
}
.middle:after {
display: table;
clear: both;
content: '';
}
.container {
width: 100%;
float: left;
overflow: hidden;
background-color: #FF99CC;
}
.content {
padding: 10 320px 0 0;
}
/**************************AWARENESS*******************************/
#awareness {
background-color: #FFF;
width: 60% ;
margin:0 40px;
text-align: center;
padding: 50px;
border-style: solid;
border-color: #993366;
border-width: 8px;
}
#awareness p {
text-align: left;
}
#awareness h3 {
color: #198D83;
text-align: left;
}
/**************************FOOTER*******************************/
.footer {
border: 8px solid #993366;
background-color: #f1f1f1;
text-align: center;
padding: 5px;
margin: 10px 0px 0px 0px;
font-size: 70%;
line-height: 10px;
}
p.explanation { text-align: left; }
#header h1 { color: #E20765; }
#signUp h2, #header h1, #header p { text-align: center; }
#header h1,{ margin: 0;
padding: 0; }
<?php
include 'protectedPage.php';
?>
<html>
<head>
<meta charset="ISO-8859-1">
<link rel="stylesheet" href="regLog.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>
<title>PINK RIBBON</title>
<body>
<div class="main">
<div id="header">
<h1>JOIN OUR COMMUNITY NOW</h1>
<p>PINK RIBBON COMMUNITY PAGE</p>
</div>
<div id='cssmenu'>
<ul>
<li><a href='main.php'><span>Home</span></a></li>
<li class='active has-sub'><a href='#'><span>Assesment Tests</span></a>
<ul>
<li class='last'><a href='#'><span>Risk Assesment Test</span></a></li>
<li class='last'><a href='#'><span>Symptom Test</span></a></li>
<li class='last'><a href='#'><span>Stage Test</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='awareness.php'><span>The Awareness</span></a>
<ul>
<li class='last'><a href='#'><span>About Breast Cancer</span></a></li>
<li class='last'><a href='#'><span>Breast Self Examination</span></a></li>
<li class='last'><a href='#'><span>Symptoms</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Types and Treatment</span></a>
<ul>
<li class='last'><a href='#'><span>Type of Treatment</span></a></li>
<li class='last'><a href='#'><span>Recovery Process</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Lifestyle</span></a>
<ul>
<li class='last'><a href='#'><span>Eat Healthy</span></a></li>
<li class='last'><a href='#'><span>Get Active</span></a></li>
</ul>
</li>
<li class='active has-sub'><a href='#'><span>Coping With Cancer</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Join and Share</span></a>
<ul>
<li><a href='#'><span>List of Forum</span></a></li>
<li class='last'><a href='#'><span>Cancer Survivor</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>What Should Us Do</span></a>
<ul>
<li><a href='#'><span>Self Support</span></a></li>
<li><a href='#'><span>Family Support</span></a></li>
<li class='last'><a href='#'><span>Public Support</span></a></li>
</ul>
</li>
</ul>
</li>
<li class='last'><a href='#'><span>Contact Us</span></a></li>
</ul>
</div>
</div>
<br><br>
<div class="middle">
<div class="container">
<main class="content">
<div id="forum">
hi!<?php echo $loginSession;?> <b id="logout">Log Out</b>
<p>Forum is bla bla bla bla</p>
<br><br>
<h2>JOIN FORUM</h2>
<br>
<h3>Share your experience of coping with cancer</h3>
<p>Alex said: <b>We need to be patient</b></p>
</div>
</main>
</div>
</div>
<div class="footer">
<strong>COPYRIGHT OF PINK RIBBON INFO4999 SECTION 1</strong>
</div>
</body>
</head>
</html>

Menu Transition Effect with Submenu

So I've hacked up this CSS menu tutorial and I'm almost done with customizing it, however I'm having 2 issues. Whenever I go over my "About" menu that contains two additional list links the transition works but then the content is shifted over to the left and fades out. The second is, i'm trying to have the bottom border slide up using CSS transition but it simply fades the color in. I've tried changing height, margin-bottom, bottom but no dice. I've attached the code and fiddle
HTML
<div id='cssmenu'>
<ul>
<li><a href='#'><span>Home</span></a></li>
<li class='has-sub'><a href='#'><span>About Us</span></a>
<ul>
<li class='has-sub'><a href='#'><span>The School</span></a>
</li>
<li class='has-sub'><a href='#'><span>Instructors</span></a>
</li>
</ul>
</li>
<li><a href='#'><span>Classes</span></a></li>
<li><a href='#'><span>Schedule</span></a></li>
<li><a href='#'><span>News</span></a></li>
<li><a href='#'><span>Programs</span></a></li>
<li class='last'><a href='#'><span>Contact</span></a></li>
</ul>
</div>
CSS
a {
-webkit-transition: all 0.2s linear 0.2s;
-moz-transition: all 0.2s linear 0.2s;
-ms-transition: all 0.2s linear 0.2s;
-o-transition: all 0.2s linear 0.2s;
transition: all 0.2s linear 0.2s;}
#cssmenu { width: 840px; padding: 0; margin: 0; border: 0; }
#cssmenu ul, #cssmenu li { list-style: none; margin: 0; padding: 0; }
#cssmenu ul { position: relative; z-index: 597; }
#cssmenu ul li { text-align:center; width: 120px; float: left; min-height: 1px; vertical-align: middle; }
#cssmenu ul li.hover, #cssmenu ul li:hover { position: relative; z-index: 599; cursor: default; }
#cssmenu ul ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; }
#cssmenu ul ul li { float: none; width: 200px; }
#cssmenu ul li:hover > ul { visibility: visible; }
#cssmenu ul ul li { bottom: 100; left: 0; margin-top: 0; font-weight: normal; }
#cssmenu a { display: block; line-height: 1em; text-decoration: none; }
#cssmenu { background: #000; font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; font-size: 12px; }
#cssmenu > ul { *display: inline-block; }
#cssmenu:after, #cssmenu ul:after { display: block; clear: both; }
#cssmenu ul ul a {background: #333;color: #FFF; border: 1px solid #fff; border-top: 0 none; line-height: 150%; padding: 16px 20px; }
#cssmenu ul ul li { position: relative; }
#cssmenu ul ul li:nth-child(1) > a { background: #333; border-bottom: 1px solid #FFF }
#cssmenu ul ul li:nth-child(1) > a:hover { color: #fff; background: #333}
#cssmenu ul ul li:nth-child(2) > a { background: #333; border-bottom: 1px solid #FFF;}
#cssmenu ul ul li:nth-child(2) > a:hover { color: #fff; background: #333; }
#cssmenu ul li:nth-child(1) > a { border-bottom: 5px solid #fff; }
#cssmenu ul li:nth-child(2) > a { border-bottom: 5px solid #ff6; }
#cssmenu ul li:nth-child(3) > a { border-bottom: 5px solid #f60; }
#cssmenu ul li:nth-child(4) > a { border-bottom: 5px solid #00f; }
#cssmenu ul li:nth-child(5) > a { border-bottom: 5px solid #0c6; }
#cssmenu ul li:nth-child(6) > a { border-bottom: 5px solid #63c; }
#cssmenu ul li:nth-child(7) > a { border-bottom: 5px solid #f00; }
#cssmenu ul li:nth-child(1) > a:hover { color: #000; background: #fff; }
#cssmenu ul li:nth-child(2) > a:hover { color: #000; background: #ff6; }
#cssmenu ul li:nth-child(3) > a:hover { background: #f60; }
#cssmenu ul li:nth-child(4) > a:hover { background: #00f; }
#cssmenu ul li:nth-child(5) > a:hover { background: #0c6; }
#cssmenu ul li:nth-child(6) > a:hover { background: #63c; }
#cssmenu ul li:nth-child(7) > a:hover { background: #f00; }
#cssmenu ul ul li.has-sub > a:after {position: absolute;top: 50%;right: 15px;margin-top: -8px; }
#cssmenu ul li.has-sub > a:after { margin-left: 5px; }
#cssmenu a { background: #000; color: #fff;padding: 0 20px; line-height: 45px; }
Try adding position: relative; to #cssmenu ul li. That will fix your issue with the sub-menu floating off to the left.
As for generating the effect of the color rising from the bottom, you could create a absolutely positioned <div> inside the <li> with a starting height of 5px and increase it to cover the entire box once you hover.
EDIT
Here is an example fiddle. http://jsfiddle.net/bbZS8/
I've only incorperated the effect on the second tab, (About Us).
#yellow-test
{
position: absolute;
bottom: -5px;
left: 0;
height: 5px;
width: 100%;
background-color: #FF6;
color: #FF6;
overflow: hidden;
line-height: 45px;
-webkit-transition: height .25s ease;
-moz-transition: height .25s ease;
-o-transition: height .25s ease;
transition: height .25s ease;
}
#cssmenu ul li:hover > div
{
height: 50px;
color: #000;
}
It's not perfect, but gives a good starting point to beginning tweaking.

center a background imaged css menu from http://cssmenumaker.com

im using ready made dropdown menu from http://cssmenumaker.com/menu/grey-red-drop-down-menu
the menu is working pretty fine but i like to center the buttons.Is there any way to do that?
Here is the css code:
#import url(http://fonts.googleapis.com/css?family=Open+Sans:600);
/* Menu CSS */#cssmenu,
#cssmenu > ul {
background: url(images/highlight-bg.png) repeat;
padding-bottom: 3px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
}
#cssmenu:before,
#cssmenu:after,
#cssmenu > ul:before,
#cssmenu > ul:after {
content: '';
display: table;
}
#cssmenu:after,
#cssmenu > ul:after {
clear: both;
}
#cssmenu {
width: auto;
zoom: 1;
}
#cssmenu > ul {
background: url(images/menu-bg.png) repeat;
margin: 0;
padding: 0;
position: relative;
}
#cssmenu > ul li {
margin: 0;
padding: 0;
list-style: none;
}
#cssmenu > ul > li {
float: left;
position: relative;
}
#cssmenu > ul > li > a {
padding: 23px 26px;
display: block;
color: white;
font-size: 13px;
text-decoration: none;
text-transform: uppercase;
text-shadow: 0 -1px 0 #0d0d0d;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7);
line-height: 18px;
}
#cssmenu > ul > li:hover > a {
background: url(images/highlight-bg.png) repeat;
text-shadow: 0 -1px 0 #97321f;
text-shadow: 0 -1px 0 rgba(122, 42, 26, 0.64);
}
#cssmenu > ul > li > a > span {
line-height: 18px;
}
#cssmenu > ul > li.active > a,
#cssmenu > ul > li > a:active {
background: url(images/hover.png) repeat;
}
/* Childs */
#cssmenu > ul ul {
opacity: 0;
visibility: hidden;
position: absolute;
top: 120px;
background: url(images/menu-bg.png) repeat;
margin: 0;
padding: 0;
z-index: -1;
}
#cssmenu > ul li:hover ul {
opacity: 1;
visibility: visible;
margin: 0;
color: #000;
z-index: 2;
top: 64px;
left: 0;
}
#cssmenu > ul ul:before {
content: '';
position: absolute;
top: -10px;
width: 100%;
height: 20px;
background: transparent;
}
#cssmenu > ul ul li {
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}
#cssmenu > ul ul li a {
padding: 18px 26px;
display: block;
color: white;
font-size: 13px;
text-decoration: none;
text-transform: uppercase;
width: 150px;
border-left: 4px solid transparent;
-webkit-transition: all 0.35s ease-in-out;
-moz-transition: all 0.35s ease-in-out;
-ms-transition: all 0.35s ease-in-out;
transition: all 0.35s ease-in-out;
}
#cssmenu > ul ul li a:hover {
border-left: 4px solid #d64e34;
background: url(images/hover.png) repeat;
}
#cssmenu > ul ul li a:active {
background: url(images/menu-bg.png) repeat;
}
Here is the basic html code:
<div id='cssmenu'>
<ul>
<li class='active'><a href='index.html'><span>Home</span></a></li>
<li class='has-sub'><a href='#'><span>Products</span></a>
<ul>
<li><a href='#'><span>Product 1</span></a></li>
<li class='last'><a href='#'><span>Product 2</span></a></li>
</ul>
</li>
<li><a href='#'><span>About</span></a></li>
<li class='last'><a href='#'><span>Contact</span></a></li>
</ul>
</div>
If you want to center the main menu links, you could try this:
#cssmenu ul {text-align: center;}
#cssmenu ul li {float: none; display: inline-block;}
Rather than float: none, you can just remove the original float on the lis.
If you are worried about the inline-block gaps that appear between the menu items, you could do this:
#cssmenu ul {text-align: center;display: table; width: 100%; word-spacing:-.25em;}
#cssmenu ul li {float: none; display: inline-block; word-spacing:0;}
To avoid the submenu text being centered, try this:
#cssmenu ul {text-align: center;display: table; width: 100%; word-spacing:-.25em;}
#cssmenu ul > li {float: none; display: inline-block; word-spacing:0;}
#cssmenu ul li li {text-align: left;}

Resources