How to have no border around a DIV - html

I have the following DIV in my page:
<div id="leftNavCustom" class="leftMenu">
<div class="menu-item">
<h4>Menu</h4>
<ul>
<li id="u"><a >Why Choose Us</a></li>
<li id="u"><a >Physicians</a></li>
<li id="u"><a >Medical Specialties</a></li>
<li id="u"><a >Locations</a></li>
<li id="u"><a >Urgent Care</a></li>
<li id="u"><a >Radiology</a></li>
<li id="u"><a >Lab</a></li>
</ul>
</div>
</div>
which creates a hover over menu expander.
My CSS is as follows:
#leftNavCustom {
display: block;
z-index: 5;
font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
line-height: 1.5;
margin: 0;
width: 240px;
-webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
padding: 0;
background: #00ff00;
}
.leftMenu {
position: fixed;
left: 22px;
top: 65px;
margin: 0;
padding: 0;
}
.menu-item, .menu-item2 {
background: url('../theImages/bg_80_b.png');
width: 240px;
font-family: 'nexa_boldregular';
font-size: 19px;
margin: 0;
padding: 0;
text-align: left;
}
/*Menu Header Styles*/
.menu-item h4 {
border-bottom: 1px solid rgba(0,0,0,0.3);
border-top: 1px solid rgba(255,255,255,0.2);
color: #fff;
font-size: 15px;
font-weight: 500;
padding: 7px 12px;
/*Gradient*/
background: #e73827; /* Old browsers */
background: -moz-linear-gradient(top, #e73827 0%, #f02f17 29%, #f6290c 47%, #f27c32 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e73827), color-stop(29%,#f02f17), color-stop(47%,#f6290c), color-stop(100%,#f27c32)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e73827 0%,#f02f17 29%,#f6290c 47%,#f27c32 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e73827 0%,#f02f17 29%,#f6290c 47%,#f27c32 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e73827 0%,#f02f17 29%,#f6290c 47%,#f27c32 100%); /* IE10+ */
background: linear-gradient(to bottom, #e73827 0%,#f02f17 29%,#f6290c 47%,#f27c32 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e73827', endColorstr='#f27c32',GradientType=0 ); /* IE6-9 */
}
/*Menu Header Styles*/
.menu-item2 h4 {
border-bottom: 1px solid rgba(0,0,0,0.3);
border-top: 1px solid rgba(255,255,255,0.2);
color: #fff;
font-size: 15px;
font-weight: 500;
padding: 7px 12px;
/*Gradient*/
background: #036ca9; /* Old browsers */
background: -moz-linear-gradient(top, #036ca9 0%, #025c90 44%, #00466e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#036ca9), color-stop(44%,#025c90), color-stop(100%,#00466e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #036ca9 0%,#025c90 44%,#00466e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #036ca9 0%,#025c90 44%,#00466e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #036ca9 0%,#025c90 44%,#00466e 100%); /* IE10+ */
background: linear-gradient(to bottom, #036ca9 0%,#025c90 44%,#00466e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#036ca9', endColorstr='#00466e',GradientType=0 ); /* IE6-9 */
}
.menu-item h4:hover {
background: #f27c32; /* Old browsers */
background: -moz-linear-gradient(top, #f27c32 0%, #f6290c 53%, #f02f17 71%, #e73827 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f27c32), color-stop(53%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f27c32 0%,#f6290c 53%,#f02f17 71%,#e73827 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f27c32 0%,#f6290c 53%,#f02f17 71%,#e73827 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f27c32 0%,#f6290c 53%,#f02f17 71%,#e73827 100%); /* IE10+ */
background: linear-gradient(to bottom, #f27c32 0%,#f6290c 53%,#f02f17 71%,#e73827 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f27c32', endColorstr='#e73827',GradientType=0 ); /* IE6-9 */
}
.menu-item2 h4:hover {
background: #00a3cc; /* Old browsers */
background: -moz-linear-gradient(top, #00a3cc 0%, #005a6e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00a3cc), color-stop(100%,#005a6e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #00a3cc 0%,#005a6e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #00a3cc 0%,#005a6e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #00a3cc 0%,#005a6e 100%); /* IE10+ */
background: linear-gradient(to bottom, #00a3cc 0%,#005a6e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00a3cc', endColorstr='#005a6e',GradientType=0 ); /* IE6-9 */
}
.menu-item h4 a, .menu-item2 h4 a {
color: white;
display: block;
text-decoration: none;
width: 240px;
}
/*ul Styles*/
.menu-item ul {
background: url('theImages/bg_80_b.png');
font-size: 13px;
line-height: 30px;
height: 0px;
list-style-type: none;
overflow: hidden;
padding: 0px;
*Animation*/
-webkit-transition: height 1s ease;
-moz-transition: height 1s ease;
-o-transition: height 1s ease;
-ms-transition: height 1s ease;
transition: height 1s ease;
}
.menu-item:hover ul {
width: 240px;
height: 300px;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
.menu-item ul li#u a {
color: #fff;
cursor: pointer;
display: block;
height: 25px;
line-height: 25px;
text-indent: 0px;
text-decoration: none;
width: 100%;
font-family: 'nexa_boldregular';
font-size: 19px;
}
/*li Styles*/
.menu-item li#u {
border-bottom: 1px #13476F solid;
padding: 8px;
}
.menu-item li#u:hover {
background: #5196AB;
}
.menu-item li#firstOne {
display: absolute;
top: 0;
left: 0;
background-color: #FFFFFF;
text-align: center;
height: 75px;
line-height: 75px;
border-bottom: 1px solid #FF7263;
vertical-align: middle;
}
.menu-item li#firstOne img {
vertical-align: middle;
}
By default it creates a big space around the menu as shown below:
The only way the menu comes out normal like I would like:
Is to add the following style to the above css file:
* {
margin: 0;
padding: 0;
}
But that makes some of my other DIVS on the page out of place. I tried adding margin and padding to every single code in my CSS but nothing works without adding the few lines shown above.
How do i modify my existing css code to fix it?
JSFIDDLE: http://jsfiddle.net/s2z6f/

Remove the margin from the specific elements that shouldn't have it (the h4 and the ul of .menu-item). You can do this rather than using * as the selector.
.menu-item h4, .menu-item ul {
margin: 0;
}
http://jsfiddle.net/v9xp2/

Try starting off with a CSS reset.
http://meyerweb.com/eric/tools/css/reset/
This will "zero out" all properties that individual browsers introduce automatically. It's generally a good practice if you're going to be writing a lot of custom styles.

Related

Horizontal navbar menu submenu alignment

In the following code, I am creating a navigation bar. When you hover on an item in the navbar, it displays a drop down menu. Certain items on the drop down menu display a submenu when hovered. All this is working, but when the submenu displays, I am having issues with the positioning of its top property. I have tried making its' parent div position:relative, adjusting it's top: position, adjusting the display property, etc., but can't seem to locate the problem.
#nav {
width: 886px;
height: 32px;
margin: 1px auto 0 auto;
border-top: 1px solid #B1B6B9;
border-bottom: 1px solid #646E73;
background-color: #A9AFB2;
/* 50% gray */
background: -moz-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #bbbfc1), color-stop(100%, #7f878b));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* IE10+ */
background: linear-gradient(to bottom, #bbbfc1 0%, #7f878b 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ffBBBFC1', EndColorStr='#ff7F878B');
padding: 0 40px;
}
.navone {
position: relative;
top: 0;
left: 0;
height: 32px;
float: left;
margin-bottom: -3px;
z-index: 150;
width: auto;
}
.navone a {
text-decoration: none;
float: left;
height: 16px;
color: #FFFFFF;
font-family: Jabas, Arial, Helvetica, sans-serif;
font-size: 19px;
padding: 5px 14px 11px 14px;
display: block;
border-left: 1px solid #B1B6B9;
border-right: 1px solid #737C81;
text-shadow: -1px -1px 0px rgba(84, 95, 101, .35);
}
.navone a:hover {
text-decoration: none;
background-color: #567697;
/* 75% dark blue */
background: -moz-linear-gradient(top, #567697 0%, #1e4975 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #567697), color-stop(100%, #1e4975));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #567697 0%, #1e4975 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #567697 0%, #1e4975 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #567697 0%, #1e4975 100%);
/* IE10+ */
background: linear-gradient(to bottom, #567697 0%, #1e4975 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ff567697', EndColorStr='#ff1E4975');
}
.navone a.active {
background-color: #89A8C7;
/* 55% blue */
background: -moz-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #89a8c7), color-stop(100%, #5480ad));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* IE10+ */
background: linear-gradient(to bottom, #89a8c7 0%, #5480ad 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ff89A8C7', EndColorStr='#ff5480AD');
}
.navone:hover .navtwo {
display: block;
}
.navtwo {
border-top: 1px solid #65809B;
display: none;
position: absolute;
top: 32px;
left: 0px;
z-index: 200;
width: 100%;
-webkit-box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
-moz-box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
}
.navtwo a {
color: #3E6082;
background-color: #D8E2EC;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: normal;
width: 90%;
height: auto;
display: block;
padding: 4px 5%;
border: 1px solid #B1C5DA;
box-sizing: box-border;
border-top: 1px solid #FFFFFF;
text-shadow: none;
}
.navtwo a:hover {
color: #FFFFFF;
background-color: #3E6082;
text-decoration: none;
}
.dropdown {
position: relative;
}
.dropdown > a {
background: #C1C5C7 !important;
color: #32393D !important;
font-weight: bold;
border-top: 1px solid #E0E2E3;
border-bottom: 1px solid #A2A8AB !important;
z-index: 50;
}
.dropdown > a:after {
float: right;
content: "\25B6"
}
.dropdown:hover > a {
background: #92999D !important;
}
.dropdown-content {
display: none;
z-index: 100;
}
.dropdown-content a {
padding: 4px 8px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
position: absolute;
top: 0;
left: 100%;
}
<div id="nav">
<!--begin of option-->
<div class="navone">
Option
<div class="navtwo">
<!--begin of dropdown menu-->
<div class="dropdown">
Test 1
<!--begin of submenu-->
<div class="dropdown-content">
Test Submenu
Test Long Submenu
Test Longest Submenu
</div>
</div>
<!--begin of dropdown menu-->
<div class="dropdown">
Test 2
<!--begin of submenu-->
<div class="dropdown-content">
Test
Long Test
The Longest Test
</div>
</div>
Test 3
</div>
</div>
<!--end of option-->
<div class="navone">
Longer Option Name
<div class="navtwo">
<div class="dropdown">
Test 1
<div class="dropdown-content">
Test Submenu
Test Long Submenu
Test Longest Submenu
</div>
</div>
Test 2
Test 3
</div>
</div>
</div>
or JSFiddle: https://jsfiddle.net/cshanno/1fsk6fm2/5/
WANTED MINE
----------- -----------
| NavOption | | NavOption |
----------- ----------- ---------
| Dropdown | | Dropdown | Submenu |
----------- ---------- ----------- ---------
| Dropdown >| Submenu | | Dropdown >| < The submenu is shifting
----------- ---------- ----------- to the top
Where the > shows the drop down item that contains sub menu options.
I made a small change on the .dropdown selector and now it's working:
.dropdown {
position: relative;
float: left;
clear: both;
width: 100%;
}
JSFiddle: https://jsfiddle.net/c71f6qzm/
Hope it helps!
The issue has to do with your display property of your .dropdowns.
if you set the display property to inline-block on those <div>s they should render more correctly. You may have to add width: 100% to your .dropdown CSS and reduce the white space in between each menu item by adding font-size: 0 to .navtwo css, but it works:
Also, Ignacio's float solution, does pretty much the same thing.
Display: block for those <div>s is the problem. floating or displaying as inline is your best solution
#nav {
width: 886px;
height: 32px;
margin: 1px auto 0 auto;
border-top: 1px solid #B1B6B9;
border-bottom: 1px solid #646E73;
background-color: #A9AFB2;
/* 50% gray */
background: -moz-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #bbbfc1), color-stop(100%, #7f878b));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #bbbfc1 0%, #7f878b 100%);
/* IE10+ */
background: linear-gradient(to bottom, #bbbfc1 0%, #7f878b 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ffBBBFC1', EndColorStr='#ff7F878B');
padding: 0 40px;
}
.navone {
position: relative;
top: 0;
left: 0;
height: 32px;
float: left;
margin-bottom: -3px;
z-index: 150;
width: auto;
}
.navone a {
text-decoration: none;
float: left;
height: 16px;
color: #FFFFFF;
font-family: Jabas, Arial, Helvetica, sans-serif;
font-size: 19px;
padding: 5px 14px 11px 14px;
display: block;
border-left: 1px solid #B1B6B9;
border-right: 1px solid #737C81;
text-shadow: -1px -1px 0px rgba(84, 95, 101, .35);
}
.navone a:hover {
text-decoration: none;
background-color: #567697;
/* 75% dark blue */
background: -moz-linear-gradient(top, #567697 0%, #1e4975 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #567697), color-stop(100%, #1e4975));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #567697 0%, #1e4975 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #567697 0%, #1e4975 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #567697 0%, #1e4975 100%);
/* IE10+ */
background: linear-gradient(to bottom, #567697 0%, #1e4975 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ff567697', EndColorStr='#ff1E4975');
}
.navone a.active {
background-color: #89A8C7;
/* 55% blue */
background: -moz-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #89a8c7), color-stop(100%, #5480ad));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #89a8c7 0%, #5480ad 100%);
/* IE10+ */
background: linear-gradient(to bottom, #89a8c7 0%, #5480ad 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#ff89A8C7', EndColorStr='#ff5480AD');
}
.navone:hover .navtwo {
display: block;
}
.navtwo {
border-top: 1px solid #65809B;
display: none;
position: absolute;
top: 32px;
left: 0px;
z-index: 200;
width: 100%;
font-size: 0;
-webkit-box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
-moz-box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
box-shadow: 4px 4px 3px rgba(84, 95, 101, .3);
}
.navtwo a {
color: #3E6082;
background-color: #D8E2EC;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: normal;
width: 90%;
height: auto;
display: block;
padding: 4px 5%;
border: 1px solid #B1C5DA;
box-sizing: box-border;
border-top: 1px solid #FFFFFF;
text-shadow: none;
}
.navtwo a:hover {
color: #FFFFFF;
background-color: #3E6082;
text-decoration: none;
}
.dropdown {
position: relative;
display: inline-block;
width:100%;
}
.dropdown > a {
background: #C1C5C7 !important;
color: #32393D !important;
font-weight: bold;
border-top: 1px solid #E0E2E3;
border-bottom: 1px solid #A2A8AB !important;
z-index: 50;
}
.dropdown > a:after {
float: right;
content: "\25B6"
}
.dropdown:hover > a {
background: #92999D !important;
}
.dropdown-content {
display: none;
z-index: 100;
}
.dropdown-content a {
padding: 4px 8px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
position: absolute;
top: 0;
left: 100%;
}
<div id="nav">
<!--begin of option-->
<div class="navone">
Option
<div class="navtwo">
<!--begin of dropdown menu-->
<div class="dropdown">
Test 1
<!--begin of submenu-->
<div class="dropdown-content">
Test Submenu
Test Long Submenu
Test Longest Submenu
</div>
</div>
<!--begin of dropdown menu-->
<div class="dropdown">
Test 2
<!--begin of submenu-->
<div class="dropdown-content">
Test
Long Test
The Longest Test
</div>
</div>
Test 3
</div>
</div>
<!--end of option-->
<div class="navone">
Longer Option Name
<div class="navtwo">
<div class="dropdown">
Test 1
<div class="dropdown-content">
Test Submenu
Test Long Submenu
Test Longest Submenu
</div>
</div>
Test 2
Test 3
</div>
</div>
</div>
or JSfiddle

Hover effect in nav bar doesn't work as wished

I created a hover effect for my navigation bar / the list inside it. On hover I want to create a "pressed button" effect by applying a box shadow. But the shadow only is casted in a small box. (check picture below)
I want the shadow to fill out the whole navbar around the hovered area.
I have no idea where to put my code and would be glad about any help :)
HTML CODE:
<nav>
<div class="nav-wrapper">
<ul>
<li>Home</li>
<li>Projekte</li>
</ul>
</div>
</nav>
CSS CODE:
html, body {
margin: 0;
padding: 0;
height: 100%;
background-color:white;
font-family: 'Open Sans', sans-serif;
}
.nav-wrapper {
margin: 0 auto;
margin-top: 50px;
width: 60%;
padding-top: 5px;
padding-bottom: 5px;
color:#787878;
box-shadow: 2px 2px 3px #BDBDBD;
border-radius: 5px;
background: #f9f9f9; /* Old browsers */
background: -moz-linear-gradient(top, #f9f9f9 0%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* IE10+ */
background: linear-gradient(to bottom, #f9f9f9 0%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
}
ul {
list-style: none;
}
li {
display: inline;
padding: 0 15px;
}
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset;
}
a {
text-decoration: none;
color:#787878;
}
Add this:
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset, 2px 2px 3px #BDBDBD;
}
Preview:
Or the bevelled effect here:
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset, -2px -2px 3px #BDBDBD inset;
}
Preview:
Fiddle: http://jsbin.com/wolotuxico/1/edit?html,css,output
Update from Comments
Remove padding for .nav-wrapper and give it to li
.nav-wrapper {
padding: 0;
}
li {
display: inline-block;
padding: 15px;
}
Preview:
Fiddle: http://jsbin.com/bowawodode/2/edit
Remove the padding from the navigation and add it to the li's. Remember the border is outside the padding and inside the margin.
Example:
https://jsfiddle.net/m98yedk6/1/
.nav-wrapper {
position: relative;
margin: 0 auto;
margin-top: 50px;
width: 60%;
color:#787878;
box-shadow: 2px 2px 3px #BDBDBD;
border-radius: 5px;
background: #f9f9f9; /* Old browsers */
background: -moz-linear-gradient(top, #f9f9f9 0%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* IE10+ */
background: linear-gradient(to bottom, #f9f9f9 0%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
}
li {
display: inline-block;
padding: 10px;
}

CSS transition not working but property change is working

I am currently developing a css for a website I will publish soon ,I took so much time in the navigation bar, I am trying to make a navigation bar without using images and make it fit into users screen, and after I done it, I have a problem, I want the sub list items to drop down smothley in 2 seconds instead of poping directly
this is the CSS and the HTML
I done the transition property in .nav ul li ul li and want it to change after 2 seconds in .nav ul li:hover ul li
be gentle on me, this is my first website that I am developing from scratch :)
#charset "utf-8";
body {
margin: 0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
width: 100%;
}
.pageHeader {
position: relative;
display: block;
width: 960px;
padding: 0px;
/* [disabled]margin-top: auto;
*/
margin-right: auto;
margin-left: auto;
/* [disabled]margin-bottom: auto;
*/
float: none;
}
.pageHeader a {
text-decoration: none;
font-size: 1.4em;
position: absolute;
float: right;
bottom: 50px;
}
.homeContent {
position: relative;
display: block;
top: 105px;
background: none repeat scroll 0% 0% #FFF;
padding: 0px;
margin: 0px auto;
width: 960px;
background-color: green;
z-index: -1;
}
/* Navigation */
/* the nav div blue background color and cyan border top */
.nav {
width: 100%;
height: 50px;
max-height:50px;
border-top: 4px solid rgb(0,160,170);
background: rgb(30,87,153); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(30,87,153,1)), color-stop(99%, rgba(0,110,201,1)), color-stop(100%, rgba(125,185,232,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8', GradientType=0 ); /* IE6-8 */
}
.nav ul {
width: 960px;
margin: 0px auto;
border: 0px;
padding: 0px;
}
.nav ul li {
margin: 0px;
border-left: 1px solid gray;
padding: 0px;
float: left;
position: relative;
list-style: none;
font-family: amatic-sc;
}
.nav ul li:first-child {
border-left: 0px;
}
/* buttons/ links */
.nav ul li a {
height: 20px;
border: 0px;
margin: 0px;
padding: 15px;
font-weight: bold;
color: #fff;
text-decoration: none;
display: block;
text-shadow: 0 1px 1px rgba(251,251,251, .3);
}
.nav ul li a:hover {
background: rgb(20,155,153); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(20,155,153,1)), color-stop(99%, rgba(0,110,201,1)), color-stop(100%, rgba(125,185,232,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#149b99', endColorstr='#7db9e8', GradientType=0 ); /* IE6-8 */
color: #fff;
}
.nav ul li a:active {
color: #D1D1D1;
}
/* Nav 2nd level*/
.nav ul li ul {
display: none;
margin: 0;
padding: 0;
width: 100px;
position: absolute;
top: 50px;
left: 2px;
background-color: rgba(255,255,255,0.80);
border-left: 1px solid rgb(0,160,170);
border-right: 1px solid rgb(0,160,170);
border-bottom: 1px solid rgb(0,160,170);
}
.nav ul li ul li {
float: none;
margin: 0px;
padding: 0px;
font-size: 0.8em;
border: 0px;
font-color: black;
max-height: 0px;
-webkit-transition: max-height 2s ease 0s;
-o-transition: max-height 2s ease 0s;
-moz-transition: max-height 2s ease 0s;
-ms-transition: max-height 2s ease 0s;
transition: max-height 2s ease 0s;
}
.nav ul li ul li a {
height: 15px;
border: 0px;
margin: 0px;
padding: 5px;
color: #000000;
text-decoration: none;
display: block;
text-shadow: 0 1px 1px rgba(0,0,0, .3);
z-index: 100;
}
.nav ul li:hover ul {
display:block;
}
.nav ul li:hover ul li{
max-height:999px;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="css/style_screen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="mainPaegHeader" class="pageHeader"><img src="img/logo.gif" width="318" height="106" alt=""/>
العربية
</div>
<div class="nav">
<ul>
<li>Home</li>
<li>Second Link
<ul>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
</ul>
</li>
<li>Third Link
<ul>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
<li>sub Link</li>
</ul>
</li>
<li>More links</li>
<li>More links</li>
<li>More links</li>
<li>More links</li>
</ul>
</div>
<div class="homeContent" id="pageContent">Content for class "homeContent" id "pageContent" Goes Here</div>
<p> </p>
</body>
</html>
Thank you all for the help and effort
it was small simple mistake mentioned by skube
I was using display with transition and that is invaild, it disables animation
so I used visible property with transition instead
visibility: hidden;
visibility: visible;
I changed some css properties in order for that to work, here is the css file after the fixes
#charset "utf-8";
body {
margin: 0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
width: 100%;
}
.pageHeader {
position: relative;
display: block;
width: 960px;
padding: 0px;
/* [disabled]margin-top: auto;
*/
margin-right: auto;
margin-left: auto;
/* [disabled]margin-bottom: auto;
*/
float: none;
}
.pageHeader a {
text-decoration: none;
font-size: 1.4em;
position: absolute;
float: right;
bottom: 50px;
}
.homeContent {
position:relative;
background: none repeat scroll 0% 0% #FFF;
padding: 0px;
margin: 0px auto;
width: 960px;
background-color: green;
z-index: -1;
}
/* Navigation */
/* the nav div blue background color and cyan border top */
.nav {
width: 100%;
height: 50px;
max-height:50px;
border-top: 4px solid rgb(0,160,170);
background: rgb(30,87,153); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(30,87,153,1)), color-stop(99%, rgba(0,110,201,1)), color-stop(100%, rgba(125,185,232,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(30,87,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8', GradientType=0 ); /* IE6-8 */
}
.nav ul {
width: 960px;
margin: 0px auto;
border: 0px;
padding: 0px;
}
.nav ul li {
margin: 0px;
border-left: 1px solid gray;
padding: 0px;
float: left;
position: relative;
list-style: none;
font-family: amatic-sc;
}
.nav ul li:first-child {
border-left: 0px;
}
/* buttons/ links */
.nav ul li a {
height: 20px;
border: 0px;
margin: 0px;
padding: 15px;
font-weight: bold;
color: #fff;
text-decoration: none;
display: block;
text-shadow: 0 1px 1px rgba(251,251,251, .3);
}
.nav ul li a:hover {
background: rgb(20,155,153); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: -moz-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(20,155,153,1)), color-stop(99%, rgba(0,110,201,1)), color-stop(100%, rgba(125,185,232,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(20,155,153,1) 0%, rgba(0,110,201,1) 99%, rgba(125,185,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#149b99', endColorstr='#7db9e8', GradientType=0 ); /* IE6-8 */
color: #fff;
}
.nav ul li a:active {
color: #D1D1D1;
}
/* Nav 2nd level*/
.nav ul li ul {
visibility: hidden;
margin: 0;
padding: 0;
width: 100px;
position: absolute;
top: 50px;
left: 2px;
-webkit-transition: all 1s ease-in-out 0s;
-o-transition: all 1s ease-in-out 0s;
transition: all 1s ease-in-out 0s;
max-height: 0px;
}
.nav ul li ul li{
float: none;
margin: 0px;
padding: 0px;
font-size: 0.8em;
border: 0px;
font-color: black;
-webkit-transition: all 1s ease-in-out 0s;
-o-transition: all 1s ease-in-out 0s;
transition: all 1s ease-in-out 0s;
max-height: 0px;
border-width: 0px;
}
.nav ul li ul li a {
height: 12px;
border-left: 1px solid rgb(0,160,170);
border-right: 1px solid rgb(0,160,170);
border-collapse:collapse;
background-color: rgba(255,255,255,0.80);
margin: 0px;
padding: 5px;
color: #000000;
text-decoration: none;
text-shadow: 0 1px 1px rgba(0,0,0, .3);
z-index: 100;
}
.nav ul li ul li:last-child a{
border-bottom: 1px solid rgb(0,160,170);}
.nav ul li:hover ul {
max-height:999px;
visibility:visible;
}
.nav ul li:hover ul li{
max-height:999px;}

Background not coming in ie8

When I put the navigation background image is not coming in ie8 ie7. all other browsers are ok. I Have added the code below . Can anyone please help me to fix this is issue?/
<nav class="navigation">
<ul>
<li><a href="http://www.ticketstosrilanka.co.uk/" >Home</a></li>
<li>Flights</li>
<li>Travel Guide</li>
<li>Tours & Holidays</li>
<li>About us</li>
<li>Contact Us</li>
</ul>
</nav>
.navigation {
margin: 0px 0;
font: bold 12px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
text-transform: uppercase;
color: #444;
width:100%;
background: url("../images/menubg.png")repeat-x scroll left top transparent;
-webkit-box-shadow: 0 1px rgba(255,255,255,1) inset;
}
.navigation:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden;
}
.navigation ul {
float: left;
border-radius: 0px;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.07);
-webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.07);
overflow: hidden;
}
.navigation li {
float: left;
border-style: solid;
border-width: 1px;
border-color: #BABABA #BABABA #BABABA #FFF;
box-shadow: 0 1px rgba(255,255,255,1) inset;
-webkit-box-shadow: 0 1px rgba(255,255,255,1) inset;
background: #F7F7F7; /* Old browsers */
background: -moz-linear-gradient(top, #F7F7F7 0%, #EDEDED 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F7F7F7), color-stop(100%,#EDEDED)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #F7F7F7 0%,#EDEDED 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #F7F7F7 0%,#EDEDED 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #F7F7F7 0%,#EDEDED 100%); /* IE10+ */
background: linear-gradient(top, #F7F7F7 0%,#EDEDED 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F7F7F7', endColorstr='#EDEDED',GradientType=0 ); /* IE6-9 */
}
.navigation li:hover, navigation li.current {
box-shadow: 0 1px rgba(255,255,255,0.2) inset;
-webkit-box-shadow: 0 1px rgba(255,255,255,0.2) inset;
border-color: #262626 !important;
background: #4D4D4D; /* Old browsers */
background: -moz-linear-gradient(top, #4D4D4D 0%, #262626 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4D4D4D), color-stop(100%,#262626)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* IE10+ */
background: linear-gradient(top, #4D4D4D 0%,#262626 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4D4D4D', endColorstr='#262626',GradientType=0 ); /* IE6-9 */
}
.navigation a {
display: block;
padding: 10px 15px;
color: #444;
text-decoration: none;
text-shadow: 0 1px #FFF;
}
.navigation a.active{
box-shadow: 0 1px rgba(255,255,255,0.2) inset;
-webkit-box-shadow: 0 1px rgba(255,255,255,0.2) inset;
border-color: #262626 !important;
background: #4D4D4D; /* Old browsers */
background: -moz-linear-gradient(top, #4D4D4D 0%, #262626 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4D4D4D), color-stop(100%,#262626)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #4D4D4D 0%,#262626 100%); /* IE10+ */
background: linear-gradient(top, #4D4D4D 0%,#262626 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4D4D4D', endColorstr='#262626',GradientType=0 ); /* IE6-9 */
color:#fff;
}
.navigation a:hover, #navigation li.current a {
color: #FFF;
text-shadow: 0 1px #000;
}
.navigation li:first-child {
border-left-color: #BABABA;
border-radius: 0px 0 0 0px;
}
.navigation li:last-child {
border-radius: 0 0px 0px 0;
}
Just add float: left; to your .navigation this may solve your problem, if not , try by adding
* html .navigation{height: 1%;}
Now add this
.navigation {
background: url("../images/menubg.png") repeat-x left top; // add this line
background: url("../images/menubg.png")repeat-x scroll left top transparent; // remove this line
}
Live demo

CSS div not working

My Footer div doesn't show the background color..
Here is the style.css file in which all of the background is working except the footer..
[ Style.css]
.Footer {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
background-color: #000000;
}
body {
background: #b3dced; /* Old browsers */
background: -moz-linear-gradient(top, #b3dced 0%, #29b8e5 50%, #bce0ee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b3dced), color-stop(50%,#29b8e5), color-stop(100%,#bce0ee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* IE10+ */
background: linear-gradient(to bottom, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3dced', endColorstr='#bce0ee',GradientType=0 ); /* IE6-9 */
}
.body {
padding-top: 1px;
margin-top: 2px;
width: 1200px;
height: 500px;
}
.about_this_site__title {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
}
.logo {
margin-top: 10px;
margin-right: 500px;
}
#menu {
padding: 0;
margin: 0;
width: 1000px;
margin-right: auto;
margin-left: auto;
border-radius: 2px;
}
#menu ul {
margin: 0;
padding: 0;
border-radius: 3px;
}
#menu ul li {
background: #ffffff;
float: left;
position: relative;
border-radius: 2px;
list-style-type: none;
}
#menu ul li a {
font-family: Verdana;
font-size: 14px;
color: blue;
text-decoration: none;
display: block;
line-height: 30px;
width: 160px;
height: 30px;
text-align: center;
}
#menu ul ul {
position: absolute;
visibility: hidden;
top: 31px;
}
#menu ul li ul li a:hover {
color: white;
background: #b8e1fc; /* Old browsers */
background: -moz-linear-gradient(top, #b8e1fc 0%, #a9d2f3 10%, #90bae4 25%, #90bcea 37%, #90bff0 50%, #6ba8e5 51%, #a2daf5 83%, #bdf3fd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b8e1fc), color-stop(10%,#a9d2f3), color-stop(25%,#90bae4), color-stop(37%,#90bcea), color-stop(50%,#90bff0), color-stop(51%,#6ba8e5), color-stop(83%,#a2daf5), color-stop(100%,#bdf3fd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* IE10+ */
background: linear-gradient(to bottom, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b8e1fc', endColorstr='#bdf3fd',GradientType=0 ); /* IE6-9 */
}
#menu ul li:hover ul {
visibility: visible;
font-weight: bold;
}
#menu ul li:hover {
background: #87e0fd; /* Old browsers */
background: -moz-linear-gradient(top, #87e0fd 0%, #53cbf1 40%, #05abe0 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#87e0fd), color-stop(40%,#53cbf1), color-stop(100%,#05abe0)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* IE10+ */
background: linear-gradient(to bottom, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=0 ); /* IE6-9 */
}
The text shows up but the background doesnt.
[ index.html ]
<div class="Footer">Copyright bla blah</div>
You are opening a p tag and closing with a div tag.
<p class="Footer">Copyright bla blah</p>
Also you have not defined a background color.
Use background-color instead of colorfor it in the css.
Replace
color: #ffffff;
with
background-color: #ffffff;
Sorry i am going to rip your question apart, because someone has to.
Firstly, you are opening with a <p> tag and closing with a </div> tag. This is your first mistake. Secondly, you have not declared a background-color variable at all in the CSS provided. Thirdly, you should never use a <p> tag for ANY BLOCK elements on your page. Always use a <div></div> for your block elements. It is just good practice and valid HTML coding.
In saying that, your code should look something like the following:
[ Style.css]
.Footer {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
background-color: red;
}
[ index.html ]
<div class="Footer"><p>Copyright bla blah</p></div>
(the <p></p> tag above is purely up to you to have or not as it does allow for more flexibility in your design but not necessary to have.
Hope this helps for future endeavors.