In my sidebar, when I hover over a submenu (portfolio or contact)
I would like the red background to take up the entire background of the cell.
Do you know how I could create this?
I think the problem is here? But I don't see what priority I should add?
.sidebar .nav-links li:hover {
background: red;
}
Thanks a lot
Here is a demonstration via Stackblitz
HTML
<ul class="nav-links" id="nav-links" >
<li *ngFor="let item of menuSidebar" #itemEl >
<div *ngIf="item.sub_menu.length > 0" class="dropdown-title" (click)="showSubmenu(itemEl)">
<a>
<i [class]="item.icon"></i>
<span class="link_name">{{item.link_name}}</span>
</a>
<i class='bx bxs-chevron-down arrow'></i>
</div>
<ul class="sub-menu" [class.blank]="item.sub_menu.length == 0">
<li><a class="link_name">{{item.link_name}}</a></li>
<li *ngFor="let item_sub of item.sub_menu" routerLinkActive="active">
<a [routerLink]="[item_sub.link]">{{item_sub.link_name}}</a>
</li>
</ul>
</li>
</ul>
CSS
/* Sidebar */
.sidebar {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 260px;
background: white;
z-index: 100;
transition: all 0.5s ease;
}
.sidebar.sidebar-close {
width: 60px;
}
.sidebar .logo-details{
width: 100%;
padding: 10px 10px 10px 10px;
}
.sidebar .logo-details img{
height: 50px;
width: 80%;
display: block;
margin: 0 auto;
}
.sidebar.sidebar-close .logo-details img {
width: 37px;
height: 50px;
transform: scale(1.2) translateX(-3px);
}
.sidebar .nav-links {
height: 100%;
width: 260px;
padding-bottom: 150px;
overflow: auto;
}
.sidebar .nav-links::-webkit-scrollbar {
display: none;
}
.sidebar .nav-links li {
list-style: none;
}
.sidebar .nav-links > li {
position: relative;
width: fit-content;
}
.sidebar .nav-links li:hover {
background: red;
}
/* Dropdown Title */
.sidebar .nav-links .dropdown-title {
width: 260px;
overflow: hidden;
transition: all 0.52s ease;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}
.sidebar.sidebar-close .nav-links .dropdown-title {
width: 60px;
}
.sidebar .nav-links li i {
height: 50px;
min-width: 60px;
text-align: center;
line-height: 50px;
color: #ffa726;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease;
}
.sidebar .nav-links li:hover i,
.sidebar .nav-links li.active i {
color: white;
}
.sidebar .nav-links li.showMenu i.arrow {
transform: rotate(-180deg);
}
/* a Tag */
.sidebar .nav-links li a {
display: flex;
align-items: center;
text-decoration: none;
width: 100%;
}
/* Link Name */
.sidebar .nav-links li a .link_name {
font-size: 16px;
font-weight: 600;
color: #ffa726;
transition: all 0.4s ease;
}
.sidebar .nav-links li:hover a .link_name,
.sidebar .nav-links li.active a .link_name {
color: white;
}
.sidebar.sidebar-close .nav-links li a .link_name {
pointer-events: none;
}
/* Sub Menu */
.sidebar .nav-links li .sub-menu {
padding: 6px 6px 14px 50px;
background: #239CD3;
display: none;
transition: all 0.4s ease;
}
.sidebar .nav-links li.showMenu .sub-menu {
display: block;
}
.sidebar .nav-links li .sub-menu a {
color: #ffa726;
font-size: 15px;
padding: 7px 0;
white-space: nowrap;
transition: all 0.3s ease;
}
.sidebar .nav-links li .sub-menu li {
padding-left: 10px;
}
.sidebar .nav-links li .sub-menu li:hover a,
.sidebar .nav-links li .sub-menu li.active a {
color: black;
}
.sidebar.sidebar-close .nav-links li .sub-menu {
position: absolute;
left: 100%;
top: -10px;
margin-top: 0;
padding: 0;
border-radius: 0 6px 6px 0;
opacity: 0;
display: block;
pointer-events: none;
transition: 0s;
overflow: hidden;
}
.sidebar.sidebar-close .nav-links li .sub-menu li {
padding: 6px 15px;
width: 200px;
}
.sidebar.sidebar-close .nav-links li:hover .sub-menu {
top: 0;
opacity: 1;
pointer-events: auto;
transition: all 0.4s ease;
}
.sidebar .nav-links li .sub-menu .link_name {
display: none;
}
.sidebar.sidebar-close .nav-links li .sub-menu .link_name {
font-size: 16px;
font-weight: 600;
display: block;
}
.sidebar.sidebar-close .nav-links li .sub-menu li:first-child {
background: white;
pointer-events: none;
}
.sidebar .nav-links li .sub-menu.blank {
pointer-events: auto;
opacity: 0;
pointer-events: none;
}
.sidebar .nav-links li:hover .sub-menu.blank,
.sidebar .nav-links li.active .sub-menu.blank {
top: 50%;
transform: translateY(-50%);
}
.sidebar.sidebar-close ~ .home-section {
left: 60px;
width: calc(100% - 60px);
}
Yes, the behaviour stems from the parent .sub-menu padding. You change background color of the child li element that is pushed away by the padding.
You can remove the padding from .sub-menu container and add it to your list items accordingly (if it's required by design):
.sidebar .nav-links li .sub-menu li:nth-child(2) {
padding: 6px 6px 0 50px;
}
.sidebar .nav-links li .sub-menu li:last-child {
padding: 0 6px 14px 50px;
}
It seems like you have a padding on your .sub-menu class. Removing it should solve your problem:
.sidebar .nav-links li .sub-menu {
background: #239CD3;
display: none;
transition: all 0.4s ease;
}
Check out the box model to better understand the behaviour of padding.
Related
I would like to have the same result as this example.
For the sub-menus (portfolio, contact, etc...): a background that takes the whole width.
The titles of the submenus are almost centered
In my sidebar, I have two rubrics: Category and Markets.
Here is my example...
My problem is that the width of the submenus (Portfolio, Contact, Indice, etc..) are not wide.
There is white to the left.
I would also like to center the menu subtitles like the example I showed you.
I made an illustration of the menu here -> Stackblitz
Thank you a lot for your help and your time.
HTML
<div class="sidebar" [class.sidebar-close]="!openSidebar" >
<div class="logo-details">
<img src="https://zupimages.net/up/22/42/refj.png" />
</div>
<ul class="nav-links" id="nav-links" >
<li *ngFor="let item of menuSidebar" #itemEl routerLinkActive="active">
<div *ngIf="item.sub_menu.length == 0" class="dropdown-title">
<a [routerLink]="[item.link]">
<i [class]="item.icon"></i>
<span class="link_name">{{item.link_name}}</span>
</a>
</div>
<div *ngIf="item.sub_menu.length > 0" class="dropdown-title" (click)="showSubmenu(itemEl)">
<a>
<i [class]="item.icon"></i>
<span class="link_name">{{item.link_name}}</span>
</a>
<i class='bx bxs-chevron-down arrow'></i>
</div>
<ul class="sub-menu" [class.blank]="item.sub_menu.length == 0">
<li><a class="link_name">{{item.link_name}}</a></li>
<li *ngFor="let item_sub of item.sub_menu" routerLinkActive="active">
<a [routerLink]="[item_sub.link]">{{item_sub.link_name}}</a>
</li>
</ul>
</li>
</ul>
</div>
CSS
/* Sidebar */
.sidebar {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 260px;
background: white;
z-index: 100;
transition: all 0.5s ease;
}
.sidebar.sidebar-close {
width: 60px;
}
.sidebar .logo-details{
width: 100%;
padding: 10px 10px 10px 10px;
}
.sidebar .logo-details img{
height: 50px;
width: 80%;
display: block;
margin: 0 auto;
}
.sidebar.sidebar-close .logo-details img {
width: 37px;
height: 50px;
transform: scale(1.2) translateX(-3px);
}
.sidebar .nav-links {
height: 100%;
width: 260px;
padding-bottom: 150px;
overflow: auto;
}
.sidebar .nav-links::-webkit-scrollbar {
display: none;
}
.sidebar .nav-links li {
list-style: none;
}
.sidebar .nav-links > li {
position: relative;
width: fit-content;
}
.sidebar .nav-links li:hover {
background: #ffa726;
}
.sidebar .nav-links li.active {
background-image: linear-gradient(to right, #ffa726, #ff5722);
}
/* Dropdown Title */
.sidebar .nav-links .dropdown-title {
width: 260px;
overflow: hidden;
transition: all 0.52s ease;
/* */
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}
.sidebar.sidebar-close .nav-links .dropdown-title {
width: 60px;
}
.sidebar .nav-links li i {
height: 50px;
min-width: 60px;
text-align: center;
line-height: 50px;
color: #ffa726;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease;
}
.sidebar .nav-links li:hover i,
.sidebar .nav-links li.active i {
color: white;
}
.sidebar .nav-links li.showMenu i.arrow {
transform: rotate(-180deg);
}
/* a Tag */
.sidebar .nav-links li a {
display: flex;
align-items: center;
text-decoration: none;
width: 100%;
}
/* Link Name */
.sidebar .nav-links li a .link_name {
font-size: 16px;
font-weight: 600;
color: #ffa726;
transition: all 0.4s ease;
}
.sidebar .nav-links li:hover a .link_name,
.sidebar .nav-links li.active a .link_name {
color: white;
}
.sidebar.sidebar-close .nav-links li a .link_name {
pointer-events: none;
}
/* Sub Menu */
.sidebar .nav-links li .sub-menu {
padding: 6px 6px 14px 70px;
/* margin-top: -10px; */
background: white;
display: none;
transition: all 0.4s ease;
}
.sidebar .nav-links li.showMenu .sub-menu {
display: block;
}
.sidebar .nav-links li .sub-menu a {
color: #ffa726;
font-size: 15px;
padding: 7px 0;
white-space: nowrap;
transition: all 0.3s ease;
}
.sidebar .nav-links li .sub-menu li {
padding-left: 10px;
}
.sidebar .nav-links li .sub-menu li:hover a,
.sidebar .nav-links li .sub-menu li.active a {
color: white;
}
.sidebar.sidebar-close .nav-links li .sub-menu {
position: absolute;
left: 100%;
top: -10px;
margin-top: 0;
padding: 0;
border-radius: 0 6px 6px 0;
opacity: 0;
display: block;
pointer-events: none;
transition: 0s;
overflow: hidden;
}
.sidebar.sidebar-close .nav-links li .sub-menu li {
padding: 6px 15px;
width: 200px;
}
.sidebar.sidebar-close .nav-links li:hover .sub-menu {
top: 0;
opacity: 1;
pointer-events: auto;
transition: all 0.4s ease;
}
.sidebar .nav-links li .sub-menu .link_name {
display: none;
}
.sidebar.sidebar-close .nav-links li .sub-menu .link_name {
font-size: 16px;
font-weight: 600;
/* opacity: 1; */
display: block;
}
/* li:first-child contain .link_name */
.sidebar.sidebar-close .nav-links li .sub-menu li:first-child {
background: white;
pointer-events: none;
}
.sidebar.sidebar-close .nav-links li .sub-menu li:first-child:hover .link_name,
.sidebar.sidebar-close .nav-links li .sub-menu li:first-child.active .link_name {
color: #ffa726;
}
.sidebar .nav-links li .sub-menu.blank {
pointer-events: auto;
/* padding: 3px 20px 6px 16px; */
opacity: 0;
pointer-events: none;
}
.sidebar .nav-links li:hover .sub-menu.blank,
.sidebar .nav-links li.active .sub-menu.blank {
top: 50%;
transform: translateY(-50%);
}
.sidebar.sidebar-close ~ .home-section {
left: 60px;
width: calc(100% - 60px);
}
Your ul.sub_menu tag has a padding of 70px on the left.
At the moment you have this CSS affecting it:
.sidebar .nav-links li .sub-menu {
padding: 6px 6px 14px 70px;
background: white;
display: none;
transition: all 0.4s ease;
}
If you just add a different higher priority CSS declaration that tells it to have a different padding on the sub menu, it should work.
Here is what it looks like with a 15px padding on the left:
Also, I do see a CSS declaration that tells all ul tags to have a padding of 0. However, this is a lower priority than the mentioned code and gets overruled.
You have a 70px left padding value in the element .sidebar .nav-links li .sub-menu, which is your <ul> element. This is being generated by this shorthand line of code for the padding values:
padding: 6px 6px 14px 70px;
You need to remove this 70px value and then just tweak the padding-left value of .sidebar .nav-links li .sub-menu li which is currently set to 10px;
Actually, I will want to align the titles on the left.
I know the problem may be this line, but I don't know what properties I should use to fix my problem? :-S
.sidebar .nav-links li a {
display: flex;
justify-content: space-between;
text-decoration: none;
transition: all 0.4s ease;
border-bottom: 1px solid #ccc;
padding: 13px 0;
}
On the other hand, the icons are correctly positioned.
CSS
.sidebar .nav-links {
margin-top: 10px;
}
.sidebar .nav-links li {
position: relative;
list-style: none;
}
.sidebar .nav-links li a {
display: flex;
justify-content: space-between;
text-decoration: none;
transition: all 0.4s ease;
border-bottom: 1px solid #ccc;
padding: 13px 0;
}
.sidebar .nav-links li a.active {
background: #081D45;
}
.sidebar .nav-links li a:hover {
background: #081D45;
}
.sidebar .nav-links li i {
min-width: 60px;
text-align: center;
font-size: 18px;
color: #fff;
}
.sidebar .nav-links .item {
text-transform: uppercase;
}
.sidebar .nav-links li i.fa-chevron-down {
right: 1rem;
left: auto;
}
.sidebar .nav-links li.active i.fa-chevron-down {
transform: rotate(180deg);
}
.sidebar .nav-links li.active i {
color: white;
}
.sidebar .nav-links li a .links_name {
color: #fff;
font-size: 15px;
font-weight: 400;
white-space: nowrap;
}
HTML
<ul class="nav-links">
<li *ngFor="let menu of menus; let i = index" [class.active]="menu.active">
<ng-container>
<a class="item" (click)="selectMenu(menu)">
<i [class]="menu.iconClass"></i>
<span class="links_name">{{ menu.name }}</span>
<i class="fa fa-chevron-down"></i>
</a>
<ul
class="submenu"
#submenu
[ngStyle]="{ 'height': menu.active ? submenu.scrollHeight + 'px' : 0 + 'px' } "
>
<li *ngFor="let submenu of menu.submenu">
<a routerLink="{{ submenu.url }} "
><span class="links_subname">{{ submenu.name }}</span>
</a>
</li>
</ul>
</ng-container>
</li>
</ul>
Here is a reproduction => Stackblitz.
Thank you in advance for your time.
you can try this.
.sidebar .nav-links li a {
display: flex;
justify-content: start;
text-decoration: none;
transition: all 0.4s ease;
border-bottom: 1px solid #ccc;
padding: 13px 0;
}
.sidebar .nav-links li i.fa-chevron-down {
right: 0;
position: absolute;
}
.sidebar .nav-links li a {
display: flex;
justify-content: start;
text-decoration: none;
transition: all 0.4s ease;
border-bottom: 1px solid #ccc;
padding: 13px 0;
}
a.item i.fa-chevron-down {
position: absolute;
min-width: 30px;
right: 4px;
}
On my website at twoguysplayingzelda.com, my sub-menus (desktop view) are currently displayed vertically and I would like to change it to horizontal. When a user hovers over the tab "GAMES", I would like the sub-menu to stretch horizontally almost like a 2nd menu bar with all the games. My menu CSS code is as below. Thanks for any help!
div.navigation.section.no-padding.bg-dark {
background: #616161;
}
.main-menu {
font-family: 'Arial', sans-serif;
font-size: 1.0em;
text-align: center;
}
.main-menu li { position: relative; }
.main-menu > li { float: left; }
.main-menu > li:before {
content: none;
display: block;
position: absolute;
right: 0;
top: 50%;
margin-top: -18px;
margin-right: -13px;
}
.main-menu > li:last-child:before { content: none; }
.main-menu > li > a {
display: block;
padding-top: 12px;
padding-bottom: 12px;
padding-left: 12px;
padding-right: 12px;
font-size: 1.0em;
color: #FFFFFF;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 400;
}
.main-menu > li:first-child > a { margin-left: 0; }
.main-menu > .has-children > a,
.main-menu > .page_item_has_children > a { padding-right: 12px; position:
relative; }
.main-menu > .has-children > a::after,
.main-menu > .page_item_has_children > a::after {
content: "";
display: none;
border: 5px solid transparent;
border-top-color: #999;
position: absolute;
z-index: 1001;
right: 29px;
top: 50%;
margin-top: -2px;
}
.main-menu li:hover > a {
cursor: pointer;
background: #01B3D9;
color: #FFFFFF; }
.main-menu > .has-children:hover > a::after,
.main-menu > .page_item_has_children:hover > a::after { border-top-color:
#fff; }
/* Sub menus --------------------------------------- */
.main-menu li ul {
position: absolute;
z-index: 10000;
display: block;
left: -9999px;
top: 10px;
-webkit-opacity: 0;
-moz-opacity: 0;
opacity: 0;
z-index: 999;
-webkit-transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
}
.is_mobile .main-menu li ul {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
display: none;
}
.main-menu > li > ul { padding-top: 20px; }
.main-menu ul li {
float: none;
display: block;
border-top: 1px solid rgba(255,255,255,0.075);
}
.main-menu ul li:first-child { border-top: none; }
.main-menu ul > .has-children::after,
.main-menu ul > .page_item_has_children::after {
content: "";
color: #FFFFFF;
display: block;
border: 6px solid transparent;
border-left-color: rgba(255,255,255,0.4);
position: absolute;
z-index: 1001;
right: 10px;
top: 50%;
margin-top: -5px;
}
.main-menu ul > .has-children:hover::after,
.main-menu ul > .page_item_has_children:hover::after { border-left-color:
#fff; }
.main-menu ul li {
display: block;
width: 240px;
background: #616161;
}
.main-menu ul a {
width: 100%;
font-size: 1.0em;
background: #616161;
display: block;
text-align: left;
font-weight: 400;
padding: 3px;
padding-left: 12px;
line-height: 130%;
color: #FFFFFF;
}
.main-menu ul a:hover {
background: #01B3D9;
color: #FFFFFF;
}
.main-menu li:hover > ul {
-webkit-opacity: 1;
-moz-opacity: 1;
opacity: 1;
left: 138.25%;
margin-left: -120px;
top: 20.44px;
}
.is_mobile .main-menu li:hover ul { display: block; }
/* Deep down --------------------------------------- */
.main-menu ul li ul {
top: 5px;
}
.main-menu ul li:hover > ul {
top: 0;
left: 240px;
margin-left: 0;
}
.main-menu ul ul li { background: #3d3d3d; }
.main-menu ul ul ul li { background: #4d4d4d; }
.main-menu ul ul ul ul li { background: #4d4d4d; }
FYI, your games submenu will be too large to show horizontally.
Here's how you could do it though.
Delete this:
.main-menu li {
position: relative;
}
And add this
.main-menu li ul.sub-menu {
display: flex;
position: absolute;
left: 0;
right: 0;
overflow-x: auto;
margin: 0;
}
Should look like:
You can also add
.main-menu li ul.sub-menu {
flex-wrap: wrap;
}
Which will give you this:
I'm running into a problem in my website, where an horizontal scrollbar is always showing even when i add overflow-x: hidden to the body, html elements. Instead of hiding the scrollbar, another scrollbar is added vertically and now i have two vertical scrollbars!
This happened because i have a centered navigation and add to set a child div of that same navigation, to 100% of the viewport width. Checked the developer tools in chrome and that div is going some pixels to the right.
Anyway, since overflow didn't work, i tried to change the values of the calc() function to subtract those pixels but the horizontal scrollbar is still there.
Here is my code:
<div id="container">
<ul class="nav">
<li>home</li>
<li>
destinations
<div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
</div>
</li>
<li>about</li>
<li>contact</li>
</ul>
</div>
And the css:
body,html {
background-color: white;
border: 0;
outline: 0;
margin: 0;
padding: 0;
max-width: 100%;
overflow-x: hidden;
}
#container {
display: block;
margin: 0 auto;
text-align: center;
position: relative;
width: 100%;
}
.nav {
cursor: default;
display: inline-block;
height: 125px;
position: relative;
top: 50px;
width: auto;
-ms-flex-pack: center;
-ms-display: -ms-flexbox;
}
.nav,
.nav a,
.nav ul,
.nav li,
.nav div {
border: none;
padding: 0;
margin: 0;
outline: none;
}
.nav a {
text-decoration: none;
}
.nav li {
list-style: none;
}
.nav > li {
display: block;
float: left;
}
.nav > li > a {
display: block;
color: black;
font-family: 'Oswald', sans-serif;
font-size: 1.2em;
font-weight: 500;
text-transform: uppercase;
height: 30px;
padding: 0 20px;
position: relative;
z-index: 510;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-ms-transition: all .3s ease;
transition: all .3s ease;
}
.nav li:hover a {
background: black;
color: white;
}
.nav > li > div {
border: 1px solid black;
display: inline-block;
color: black;
position: absolute;
top: 30px;
left: calc(-50vw + 50%);
width: 100vw;
opacity: 0;
overflow: hidden;
visibility: hidden;
background: white;
z-index: 500;
-webkit-transition: all .3s ease .5s;
-moz-transition: all .3s ease .5s;
-o-transition: all .3s ease .5s;
-ms-transition: all .3s ease .5s;
transition: all .3s ease .5s;
}
.nav li:hover > div {
opacity: .7;
visibility: visible ;
overflow: hidden;
}
.nav .nav-column {
background-color: white;
float: left;
text-align: left;
top: -30px;
padding: 2%;
position: relative;
width: 15%;
}
.nav .nav-column h3 {
color: #d1a559;
font-family: Orator Std, IrisUPC, sans-serif;
font-weight: 900;
margin: 20px 0 10px 0;
text-decoration: underline ;
}
.nav .nav-column li {
padding-left: 0;
font-family: Palatino linotype, Rockwell;
}
.nav .nav-column li a {
background: white;
color: black;
display: block;
}
.nav .nav-column li a:hover {
background: #d1a559;
color: white;
-webkit-transition: all .1s ease;
-moz-transition: all .1s ease;
-o-transition: all .1s ease;
-ms-transition: all .1s ease;
transition: all .1s ease;
}
#media (max-width:1420px) {
.Thumbnails {
float: none;
}
}
#media (max-width: 950px) {
.nav li:hover > div {
background-color: white;
opacity: 1;
}
.nav .nav-column {
position: relative;
width: 20%;
}
.nav .nav-column li {
list-style: none;
}
}
#media (max-width: 700px) {
.nav li:hover > div {
background-color: white;
left: 0;
opacity: 1;
width: 100%;
}
.nav .nav-column {
float: none;
}
}
.colAbout {
display: block;
float: none;
}
.span_1_of_3 {
width: 70%;
}
#media (max-width: 530px) {
.nav {
display: none;
text-align: left;
height: 150px;
top: 0;
padding: 0;
margin: 0;
position: relative;
z-index: 999;
}
.nav li {
float: none;
left: 0;
}
.nav li:hover > div {
opacity: 1;
top: 113px;
}
.nav > li > a {
border-right: none;
display: block;
left: 0;
}
/*Div contendo responsive button*/
#menu {
border: 1px solid black;
color: black;
cursor: pointer;
display: block;
font-size: 1.3em;
left: 0;
margin: 5%;
position: relative;
text-align: center;
z-index: 540;
width: 1.4em;
}
#container {
left: 0;
display: block;
padding: 0;
position: relative;
width: 100%;
}
ul {
width: 100%;
list-style: none;
}
}
#media (min-width: 530px) {
#menu {
display: none;
}
}
And a fiddle example
If you just want to hide the scrollbar:
#container {
overflow: hidden!important;
}
I encountered the same issue. I still don't know the root cause, but setting overflow to "-moz-hidden-unscrollable" seems to hide the scrollbar.
.container {
overflow: -moz-hidden-unscrollable
}
I have checked your CSS. To prevent the scrollbar from being displayed, you should comment out two CSS properties: position: relative; top: 34px;
.nav {
cursor: default;
display: inline-block;
height: 125px;
width: auto;
-ms-flex-pack: center;
-ms-display: -ms-flexbox;
}
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>