I want to get Div with background colored and put #title aligned to left and <nav> aligned to left and both of them in one line.
I couldn't get them into one line! And I couldn't give #Header background-color.
/* Reset */
html, body, div, h1, h2, h3, a, p, img, ul, li, footer, fieldset, form, label, header, section {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
.page {
background-color: #fff;
}
#banner {
padding: 8em 0 5em 0;
height: 75vh;
background-image: url(images/banner1.jpg);
background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
text-align: center;
position: relative;
}
#semiopacity {
background-color: rgba(20, 15, 10, 0.7);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
a {
margin: 0 0 2em 0;
font-weight: 700;
font-size: 20px;
color: #fff;
text-decoration: none;
font-family: Lato, serif;
}
p {
margin: 0 0 2em 0;
font-weight: 700;
font-size: 20px;
color: #fff;
}
h1,
h2,
h3 {
font-weight: 700;
line-height: 1.5;
margin: 0 0 1em 0;
font-family: Lato, serif;
color: #fff;
}
h1 {
margin-top: 6em;
font-size: 2em;
text-align: center;
}
h2 {
margin-bottom: 2em;
text-align: center;
font-size: 1.5em;
}
#header {
padding: 1em 0 2em 0;
background: #e6e6e6;
}
nav {
margin: 0;
padding: 0;
text-align: right;
}
#title {
font-size: 1.3em;
margin: 1em 1em 0 0;
text-align: left;
margin: 0;
}
#main {
font-size: 1.3em;
margin: 1em 2em 0 0;
}
#lang {
font-size: 1.3em;
margin: 1em 1em 0 0;
}
<title>KAZAKHSTAN — world's large center of travel</title>
<meta charset="utf-8">
<div class="page">
<section id="banner">
<section id="semiopacity">
<div id="Header">
KAZAKHSTAN
<nav>
<ol>
<tr>MAIN</tr>
<tr>CONTACT</tr>
</ol>
</nav>
</div>
<h1>KAZAKHSTAN</h1>
<p>KAZAKHSTAN — WORLD'S LARGE CENTER OF TRAVEL.</p>
</section>
</section>
<section id="description">
</section>
</div>
I tried to fix it:
/* Reset */
html, body, div, h1, h2, h3, a, p, img, ul, li, footer, fieldset, form, label, header, section {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
.page {
background-color: #fff;
}
#banner {
padding: 8em 0 5em 0;
height: 75vh;
background-image: url(images/banner1.jpg);
background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
text-align: center;
position: relative;
}
#semiopacity {
background-color: rgba(20, 15, 10, 0.7);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
a {
margin: 0 0 2em 0;
font-weight: 700;
font-size: 20px;
color: #fff;
text-decoration: none;
font-family: Lato, serif;
}
p {
margin: 0 0 2em 0;
font-weight: 700;
font-size: 20px;
color: #fff;
}
h1,
h2,
h3 {
font-weight: 700;
line-height: 1.5;
margin: 0 0 1em 0;
font-family: Lato, serif;
color: #fff;
}
h1 {
margin-top: 6em;
font-size: 2em;
text-align: center;
}
h2 {
margin-bottom: 2em;
text-align: center;
font-size: 1.5em;
}
#header {
padding: 1em 0 5em 0;
background-color: rgba(20, 15, 10, 0.7);
}
#nav {
margin: 0;
padding: 0;
text-align: right;
float: left;
}
#title {
font-size: 1.3em;
margin: 0;
}
#main {
font-size: 1.3em;
margin: 1em 2em 0 0;
}
#lang {
font-size: 1.3em;
margin: 1em 1em 0 0;
}
#buttons {
font-size: 1.3em;
margin: 1em 1em 0 0;
text-align: left;
margin: 0;
float: left;
}
<title>KAZAKHSTAN — world's large center of travel</title>
<meta charset="utf-8">
<div class="page">
<section id="banner">
<section id="semiopacity">
<div id="Header">
<div id="nav">
<ol>
<tr><a id="title" href="#">KAZAKHSTAN</a></tr>
<tr>MAIN</tr>
<tr>CONTACT</tr>
</ol>
</div>
</div>
<h1>KAZAKHSTAN</h1>
<p>KAZAKHSTAN — WORLD'S LARGE CENTER OF TRAVEL.</p>
</section>
</section>
<section id="description">
</section>
</div>
Related
I want the 'William Marchesi' and 'Contact' Text centered vertically with the 'Contact' Button on the right of the header. When I try a float: right, the contact text moves so that it is higher than the 'William Marchesi' text.
html {
height: 100%;
background-repeat: no-repeat;
background-color: green;
}
body {
font-size: 87.5%;
/* Base font size on 14px */
font-family: sans-serif;
line-height: 1.5;
text-align: justify;
margin: 0 auto;
padding: 0;
}
a {
text-decoration: none;
color: inherit;
}
.header div {
margin: 0 auto;
width: 70%;
clear: both;
padding: 0;
}
.header {
background-color: #FCFCFC;
width: 100%;
padding: 0;
margin: 0 auto;
/*height: 5em;*/
}
.heading,
.contactButton {
display: inline-block;
padding: 0;
margin: 0;
vertical-align: middle;
line-height: 3em;
height: 3em;
font-family: 'Nunito', sans-serif;
}
.heading {
font-size: 3em;
padding: 0;
margin: 0;
}
.contactButton {
font-size: 2em;
text-align: right;
padding: 0;
margin: 0;
float: right;
}
<body class="body">
<div class="header">
<div>
<h1 class="heading">William Marchesi</h1>
<a class="contactButton" href="#contact">Contact</a>
</div>
</div>
</body>
Here's one of many possible solutions, using position:absolute on the contact button.
html {
height: 100%;
background-repeat: no-repeat;
background-color: green;
}
body {
font-size: 87.5%; /* Base font size on 14px */
font-family: sans-serif;
line-height: 1.5;
text-align: justify;
margin: 0 auto;
padding: 0;
}
a {
text-decoration: none;
color: inherit;
}
.header div {
margin: 0 auto;
padding: 0;
text-align:center;
}
.header {
background-color: #FCFCFC;
padding: 0;
}
.heading, .contactButton {
padding: 0;
margin: 0;
vertical-align: middle;
line-height: 3em;
font-family: 'Nunito', sans-serif;
}
.heading {
font-size: 3em;
padding: 0;
margin: 0;
}
.contactButton {
font-size: 2em;
text-align: right;
padding: 0;
margin: 0;
position:absolute;
top:0.8em;
right:1em;
}
<div class="header">
<div>
<h1 class="heading">William Marchesi</h1>
<a class="contactButton" href="#contact">Contact</a>
</div>
</div>
You can use margin-left instead of float
html {
height: 100%;
background-repeat: no-repeat;
background-color: green;
}
body {
font-size: 87.5%; /* Base font size on 14px */
font-family: sans-serif;
line-height: 1.5;
text-align: justify;
margin: 0 auto;
padding: 0;
}
a {
text-decoration: none;
color: inherit;
}
.header div {
margin: 0 auto;
width: 70%;
clear: both;
padding: 0;
}
.header {
background-color: #FCFCFC;
width:100%;
padding: 0;
margin: 0 auto;
/*height: 5em;*/
}
.heading, .contactButton {
display: inline-block;
padding: 0;
margin: 0;
vertical-align: middle;
line-height: 3em;
height: 3em;
font-family: 'Nunito', sans-serif;
}
.heading {
font-size: 3em;
padding: 0;
margin: 0;
}
.contactButton {
font-size: 2em;
text-align: right;
padding: 0;
margin-left: 59%;
}
Here's a flexbox solution that makes centering simple and easy:
body {
background-color: green;
font-size: 87.5%;
margin: 0;
padding: 0;
}
.header {
display: flex;
justify-content: space-around; /* horizontal alignment of children */
align-items: center; /* vertical alignment of children */
height: 6rem;
background-color: #FCFCFC;
}
.heading {
font-size: 3em;
font-family: 'Nunito', sans-serif;
}
.contactButton {
font-size: 2em;
font-family: 'Nunito', sans-serif;
}
a {
text-decoration: none;
color: inherit;
}
<body class="body">
<div class="header">
<h1 class="heading">William Marchesi</h1>
<a class="contactButton" href="#contact">Contact</a>
</div>
</body>
jsFiddle
More about flex centering here:
How to Center Elements Vertically and Horizontally in Flexbox
Center and right align flexbox elements
Browser support: Flexbox is supported by all major browsers, except IE < 10. Some recent browser versions, such as Safari 8 and IE10, require vendor prefixes. For a quick way to add prefixes use Autoprefixer. More details in this answer.
You can do this using flexbox (display: flex) quite easily.
Try my jsFiddle.
So initially the top half of my black menu blocks appeared over the top of the banner, but now the top half of them are cut off underneath of the banner like this:
Here is my styles.css file:
/* Base */
* {
margin: 0;
padding: 0;
}
body {
/*background-color: #F5F4F1;*/
background-image: url('./img/bg.jpg');
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 20px;
color: #353535;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#banner {
position: relative;
}
#banner__text-content {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 100%;
text-align: center;
}
#banner__title {
font-size: 5.8rem;
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
}
h1,h2,h3,h4,h5,h6 {
margin: 30px 0;
/*font-weight: 200;*/
color: #8ca757;
}
h1 {
font-size: 35px;
}
h1 small {
font-size: 25px;
color: #666;
}
h2 + p {
margin-top: -20px;
}
h3 + p {
margin-top: -20px;
}
h2,h3,h4 {
font-size: 30px;
}
h4.error {
color: #faa722;
}
h5,h6 {
font-size: 20px;
}
p {
margin: 0 0 20px;
}
a:link, a:visited {
color: #8ca757;
}
a:hover {
color: #7a9347;
}
ul, ol {
margin: 0 0 10px 18px;
}
ul li, ol li {
margin: 0 0 15px;
}
hr {
border: none;
height: 18px;
width: 114px;
background-image: url('./img/hr.png') center center no-repeat;
margin: 20px auto;
}
small {
font-size: 12px;
}
blockquote {
background: white;
padding: 10px;
margin: 0 0 15px;
border-left: solid 4px #d1cbb8;
font-style: italic;
}
blockquote p {
margin: 5px 0 10px;
}
blockquote code {
font-style: normal;
}
code {
color: #006699;
font-weight: bold;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
}
sup {
font-size: 0.6em;
}
/* Layout */
.wrapper {
position: relative;
width: 620px;
margin: 40px auto;
padding: 40px;
background: white;
text-align: center;
}
.wrapper:before, .wrapper:after {
content: "";
position: absolute;
top: 5px;
left: -5px;
width: 100%;
height: 100%;
background: #97917e;
z-index: -1;
}
.wrapper:before {
top: 10px;
left: -10px;
background: #514933;
}
#logo {
width: 240px;
margin: 0 auto;
display: block;
}
.sandbox {
padding: 20px;
background: #f8f5f1;
text-align: left;
}
aside {
background: white;
border: dashed 2px #97917e;
padding: 10px 20px;
margin: 40px;
}
aside h3 {
font-size: 24px;
margin-top: 10px;
}
aside h6 {
margin: 15px 0 5px;
}
table {
width: 100%;
font-size: 13px;
background: white;
margin: 0 0 20px;
}
table td {
border-bottom: solid 1px #d1cbb8;
padding: 4px;
}
table th {
background: #8ca757;
color: white;
padding: 4px;
font-weight: normal;
font-size: 15px;
}
/* Global */
input {
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
autton, input.button {
display: inline-block;
background: #ccc;
outline: solid 2px #ccc;
border: solid 2px white;
color: white;
padding: 10px 15px;
margin: 20px 0;
text-decoration: none;
font-family: inherit;
font-size: inherit;
font-weight: bold;
cursor: pointer;
}
.button:hover, input.button:hover {
background: #bbb;
outline-color: #bbb;
}
.button.prev {
float: left;
background: #514933;
outline-color: #514933;
}
.button.prev:hover {
background: #494331;
outline-color: #494331;
}
.button.next, input.button.next {
background: #8ca757;
outline: solid 2px #8ca757;
float: right;
}
.button.next:hover, input.button.next:hover {
background: #7c9745;
}
input.button.next {
display: block;
float: none;
width: 100%;
}
.block {
display: block;
}
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}
.copyright-info h4, .copyright-info h5 {
margin: 0;
line-height: 18px;
font-size: 14px;
text-align: center;
}
.copyright-info h4 {
font-weight: bold;
}
.copyright-info {
margin: 20px 0 40px;
}
/* Final example website */
#final-example .wrapper {
width: 800px;
padding: 0;
}
#final-example .content {
padding: 20px 50px 50px;
text-align: left;
}
#final-example #nav {
margin: -27px 0 0;
}
#final-example #nav ul {
display: inline-block;
list-style: none;
text-align: left;
}
#final-example #nav ul li {
display: inline-block;
text-align: center;
margin: 0 10px;
}
#final-example #nav ul li a {
display: block;
background: #353535;
outline: solid 2px #353535;
border: solid 2px white;
color: white;
padding: 10px 15px;
text-decoration: none;
}
#final-example #nav ul li a:hover {
background: #8ca757;
outline: solid 2px #8ca757;
}
#final-example #philosophy {
text-align: center;
font-size: 18px;
line-height: 22px;
}
#final-example #footer {
font-size: 12px;
line-height: 15px;
margin: 60px 0 0 0;
}
#final-example #footer strong {
display: block;
margin: 0 0 20px;
}
#final-example .column {
display: block;
float: left;
}
#final-example .column.three {
width: 203px;
margin-right: 45px;
}
#final-example .column.last {
margin: 0;
}
#final-example small {
display: block;
text-align: center;
margin: 40px 0 0;
}
#final-example .member {
width: 203px;
float: left;
margin-right: 45px;
}
#final-example .member:last-child {
margin: 0;
}
#final-example .member img {
max-width: 100%;
}
#final-example .closed {
color: #d13916;
}
#final-example .open {
color: #67b512;
}
#menu-items ul {
list-style: none;
margin: 0;
padding: 20px 0;
text-align: center;
font-size: 18px;
}
#menu-items ul li a {
text-decoration: none;
font-weight: bold;
}
.price {
float: right;
font-size: 18px;
font-weight: bold;
color: #353535;
}
#contact {
width: 320px;
margin: 0 auto;
}
#contact-form label {
display: block;
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
}
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
border: solid 2px #353535;
outline: none;
font-size: 18px;
padding: 10px;
margin: 0 0 10px;
width: 300px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#contact-form textarea {
resize: vertical;
height: 120px;
}
#contact-form input[type="checkbox"] + label {
display: inline;
cursor: pointer;
}
When I try to do this:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
}
to this
#final-example #nav {
margin: -27px 0 0;
}
this happens:
and text-align:center; did not work. Any ideas?
Here is the index.php:
<!DOCTYPE html>
<html>
<head>
<title>MicroUrb</title>
<link rel="stylesheet" href="assets/styles.css">
</head>
<body id="final-example">
<div class="wrapper">
<div id="banner">
<a href="/" title="Return to Home">
<img src="assets/img/banner0.jpg" alt="MicroUrb">
<div id="banner__text-content">
<h1 id="banner__title">MicroUrb</h1>
</div>
</a>
</div><!-- banner -->
<div id="nav">
<ul>
<li>Home</li>
<li>Team</li>
<li>Products</li>
<li>Contact</li>
</ul>
</div><!-- nav -->
<div class="content">
<div id="footer" class="cf">
<div class="column three">
<strong>Phone</strong>
609.505.3395
</div><!-- column -->
<div class="column three">
<strong>Location</strong>
<!-- location to go here -->
</div><!-- column -->
<div class="column three last">
<strong>Hours</strong>
<em>Tuesday - Thursday</em><br>
1:00pm - 9:00pm<br><br>
<em>Friday and Saturday</em><br>
4:00pm - 11:00pm<br><br>
<em>Sunday - Monday</em>
Closed<br><br>
</div><!-- column -->
</div><!-- footer -->
<small>©2017 MicroUrb</small>
</div><!-- content -->
</div><!-- wrapper -->
<div class="copyright-info">
<?php includes('../assets/includes/copyright.php'); ?>
</div><!-- copyright-info -->
</body>
</html>
Put a z-index on the nav and set the position to relative
#final-example #nav {
margin: -27px 0 0;
z-index: 5;
position: relative;
}
I believe to get the navigation in front of the banner like you are trying to achieve you could utilise the z-index property.
Add a z-index of 1 to your #final-example #nav {} and a z-index of 0 to your #banner {} which will bring the navigation in front of the banner while keeping its absolute positioning in the centre.
The final outcome will be:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
z-index: 1;
}
#banner {
position: relative;
z-index: 0;
}
Let me know if you need any other help.
You can use z-index on the nav element to make it appear above the banner if you set the banner to a lower z-index compared to the nav element.
So for example:
#final-example #nav {
z-index:1;
position:relative;
margin:-27px auto 0;
}
That said, it would be useful if you would've posted your html part as well.
Edit:
Further investigation and with a temporary asset, the code seems to work fine with the code posted above as can be seen in this JSFiddle: https://jsfiddle.net/t2d70q3y/2/
Let me know if you require further assistance.
I am trying to figure out this gap in between the nav and the "home" image. Every time I try with any margin-top: -15px the div class="inner" jumps to the far right of the image.
I'm still learning so I'm assuming its something pretty simple that I'm overlooking or have added too much junk code. This is also my 1st post on here so I'm hoping it all comes out correctly.
/**************************
GENERAL
**************************/
body {
font-family: 'Open Sans', sans-serif;
margin: 0;
padding: 0;
position: relative;
background-color: #fff;
}
img {
max-width: 100%;
margin: 0;
padding: 0;
border: 0;
}
a {
text-decoration: none;
color: #4E4E4E;
}
h1 {
color: #4E4E4E;
font: normal 50px 'oswald', sans-serif;
margin: 15px 0;
font-size: 1.75em;
font-weight: normal;
line-height: 0.8em;
}
h2 {
color: #4E4E4E;
font-size: 0.75em;
margin: -5px 0 0;
font-weight: normal;
}
h3 {
color: #4E4E4E;
margin: 0 0 1em 0;
color: #384047;
}
#wrapper {
position: relative;
width: 100%;
background: #fff;
}
/**************************
NAVIGATION
**************************/
/* Clearfix */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
/* Basic Styles */
nav {
height: 60px;
width: 100%;
background: #fff;
font-size: 13pt;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
position: relative;
padding-top: 10px;
border-bottom: solid 1px #666;
z-index: 999;
}
nav ul {
padding: 0;
margin: 0 auto;
width: 625px;
}
nav li {
display: inline;
float: left;
}
nav a {
color: #4E4E4E;
display: inline-block;
width: 125px;
text-align: center;
text-decoration: none;
line-height: 40px;
}
nav li:last-child a {
border-right: 0;
}
nav a:hover, nav a:active {
color: #77308f;
}
nav a#pull {
display: none;
}
/**************************
HOME | SLIDES | SPLASH
**************************/
#slides {
max-width: 100%;
height: 1122px;
background: url('http://greytprints.com/images/home_bg.jpg') no-repeat top center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: block;
z-index: -2;
}
#slides .inner {
position: relative;
top: 60%;
text-align: center;
width: 100%;
text-shadow: 0 0 2px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.4);
}
#slides .inner h1 {
color: #fff;
font-weight: 600;
font-size: 60px;
text-transform: uppercase;
letter-spacing: 1px;
}
#slides .inner h2 {
color: #fff;
font-weight: 400;
font-size: 40px;
text-transform: uppercase;
letter-spacing: 1px;
}
img.bg {
/* Set rules to fill background */
min-height: 100%;
min-width: 2000px;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}
<nav class="clearfix">
<ul class="clearfix">
<li>Newsletter</li>
<li>Store</li>
<li id="hide_logo"><img src="images/gp_logo_color.png" width="55" height="55"></li>
<li>About Us</li>
<li>Connect</li>
</ul>
Menu
</nav>
<div id="wrapper">
<div id="slides" name="home">
<div class="inner">
<h1>WE ARE GREYT PRINTS</h1>
<br>
<span><h2>AND WE LOVE GREYHOUNDS</h2></span>
</div>
</div>
</div>
The problem is margin collapse, because inside #wrapper there is a <h1> with some margin-top.
In this case, you can fix it using absolute positioning instead of relative one. This way .inner (including <h1>) will be removed from the normal flow of the document, so the margin won't affect #wrapper.
#slides .inner {
position: absolute;
}
/**************************
GENERAL
**************************/
body {
font-family: 'Open Sans', sans-serif;
margin: 0;
padding: 0;
position: relative;
background-color: #fff;
}
img {
max-width: 100%;
margin: 0;
padding: 0;
border: 0;
}
a {
text-decoration: none;
color: #4E4E4E;
}
h1 {
color: #4E4E4E;
font: normal 50px 'oswald', sans-serif;
margin: 15px 0;
font-size: 1.75em;
font-weight: normal;
line-height: 0.8em;
}
h2 {
color: #4E4E4E;
font-size: 0.75em;
margin: -5px 0 0;
font-weight: normal;
}
h3 {
color: #4E4E4E;
margin: 0 0 1em 0;
color: #384047;
}
#wrapper {
position: relative;
width: 100%;
background: #fff;
}
/**************************
NAVIGATION
**************************/
/* Clearfix */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
/* Basic Styles */
nav {
height: 60px;
width: 100%;
background: #fff;
font-size: 13pt;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
position: relative;
padding-top: 10px;
border-bottom: solid 1px #666;
z-index: 999;
}
nav ul {
padding: 0;
margin: 0 auto;
width: 625px;
}
nav li {
display: inline;
float: left;
}
nav a {
color: #4E4E4E;
display: inline-block;
width: 125px;
text-align: center;
text-decoration: none;
line-height: 40px;
}
nav li:last-child a {
border-right: 0;
}
nav a:hover, nav a:active {
color: #77308f;
}
nav a#pull {
display: none;
}
/**************************
HOME | SLIDES | SPLASH
**************************/
#slides {
max-width: 100%;
height: 1122px;
background: url('http://greytprints.com/images/home_bg.jpg') no-repeat top center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: block;
z-index: -2;
}
#slides .inner {
position: absolute;
top: 60%;
text-align: center;
width: 100%;
text-shadow: 0 0 2px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.4);
}
#slides .inner h1 {
color: #fff;
font-weight: 600;
font-size: 60px;
text-transform: uppercase;
letter-spacing: 1px;
}
#slides .inner h2 {
color: #fff;
font-weight: 400;
font-size: 40px;
text-transform: uppercase;
letter-spacing: 1px;
}
img.bg {
/* Set rules to fill background */
min-height: 100%;
min-width: 2000px;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}
<nav class="clearfix">
<ul class="clearfix">
<li>Newsletter</li>
<li>Store</li>
<li id="hide_logo"><img src="images/gp_logo_color.png" width="55" height="55"></li>
<li>About Us</li>
<li>Connect</li>
</ul>
Menu
</nav>
<div id="wrapper">
<div id="slides" name="home">
<div class="inner">
<h1>WE ARE GREYT PRINTS</h1>
<br>
<span><h2>AND WE LOVE GREYHOUNDS</h2></span>
</div>
</div>
</div>
I have a main css file.. It is common to all my jsp. On my other jsp, I need to remove a background picture.. How can i overlapped it?
Part of the css that should be overlapped.
#body .header div {
background: url(images/smiling-man.jpg) no-repeat bottom right; --> i want this
removed. by overlapping it with another css.
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
This is what i have done.. just removing the the background does not worked and added a class overlap on the div.
.overlap{
background:none;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
My HTML
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%# taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="product.css">
<title>Lot Movement Main Page</title>
</head>
<body>
<body>
<div id="header">
<div id="logo">
<img src="images/logo.jpg" alt="" />
</div>
<nav>
<ul>
<li class="selected"><span>home</span></li>
<li> <span>Product </span>
<ul>
<li>
<span>Input</span>
</li>
<li>
<span>Enquiry</span>
</li>
</ul>
</li>
<li><span>Movement</span></li>
<li><span>contact us</span></li>
</ul>
</nav>
</div>
<div id="body">
<div class="header">
<div id ="prodoverlap">
<h3>Lot Movement Tracking System</h3>
</div>
</div>
</div>
</div>
<div id="footer">
<div>
<div>
<h3>AusTralAsia</h3>
<ul>
<ul>
<li>+630212013129 -Main</li>
</ul>
</ul>
</div>
<div>
<h3>europe</h3>
<ul>
<li>To Be Announced</li>
</ul>
</div>
<div>
<h3>canada</h3>
<ul>
<li>To Be Announced</li>
<li></li>
</ul>
</div>
<div>
<h3>middle east</h3>
<ul>
<li>To Be Announced</li>
<li></li>
</ul>
</div>
<div>
<h3>follow us:</h3>
<a class="facebook" href="http://www.facebook.com/" target="_blank">facebook</a>
<a class="twitter" href="http://twitter.com" target="_blank">twitter</a>
</div>
</div>
<div>
<p>© Copyright 2012. All rights reserved</p>
</div>
</div>
</body>
</body>
</html>
My Main CSS
/* Template by freewebsitetemplates.com */
body {
font-family: Arial, Helvetica, sans-serif;
margin:0;
padding: 0;
}
#header {
margin:0 auto;
padding: 0;
overflow: hidden;
width: 960px;
}
#header #logo {
float: left;
height: 144px;
width: 355px;
}
#header #logo img {
border: 0;
}
#header ul li {
list-style-type: none;
float: left;
margin: 0;
padding: 0;
width: 121px;
}
#header ul li a,
#header ul li a span,
#header ul li a:hover,
#header ul li a:hover span,
#header ul li.selected a,
#header ul li.selected a span
{
background: url(images/menu.gif);
}
#header ul li a
{
background-position: 10px 0;
color: #2a4f5e;
display: block;
font-size: 14px;
height: 36px;
line-height: 36px;
margin: 0;
padding: 0 0 0 10px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
text-shadow: 1px 1px 1px #fff;
}
#header ul li a span
{
background-position: -70px 0;
display: block;
margin: 0;
padding: 0 10px 0 0;
}
#header ul li a:hover {
background-position: -186px -37px;
color: #346b84;
text-shadow: none;
}
#header ul li a:hover span {
background-position: -70px -37px;
}
#header ul li.selected a{
background-position: 10px 36px;
color: #fff;
text-shadow: none;
}
#header ul li.selected a span{
background-position: -70px -74px;
}
/*dropdown*/
#header ul ul {
display: none;
}
#header ul li:hover > ul {
display: block;
}
#header ul ul li a span
{
background-position: -70px 0;
font-size: 10px;
text-transform: none;
display: block;
margin: 0;
padding: 0 10px 0 0;
}
#header ul ul li a:hover {
background-position: -186px -37px;
color: #346b84;
text-shadow: none;
}
#body {
background: url(images/bg-content.gif) repeat-x top left;
margin: 0;
padding: 0;
min-width: 960px;
}
#body .header {
background: url(images/bg-body.gif) repeat-x bottom center;
margin: 0 0 30px 0;
}
#body .header div {
background: url(images/smiling-man.jpg) no-repeat bottom right;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
#body .header div div {
background: none;
margin: 0;
padding: 0 0 0 13px;
height: 200px;
width: 490px;
}
#body .header div h3 {
color: #2a4f5e;
font-size: 20px;
line-height: 30px;
margin: 18px 0 0 0;
padding: 0;
text-shadow: 1px 1px 1px #fff;
}
#body .header div h3 span {
display: block;
font-size: 25px;
}
#body .header div h3 a {
color: #2a4f5e;
text-decoration: none;
}
#body .header div h3 a:hover {
color: #507685;
}
#body .header div p {
color: #507685;
font-size: 14px;
line-height: 24px;
margin: 12px 0 6px 0;
padding: 0;
text-shadow: 1px 1px 1px #fff;
}
#body .header div p a {
color: #507685;
}
#body .header div p a:hover {
color: #2a4f5e;
}
#body .header ul {
overflow: hidden;
margin: 0;
padding: 49px 0 0;
}
#body .header ul li {
float: left;
list-style: none;
padding: 0 5px;
}
#body .body {
border: 1px solid #e0e0e0;
margin: 0 auto 34px auto;
overflow: hidden;
padding: 0 2px;
width: 954px;
}
#body .body div {
float: left;
}
#body .body .section {
background: url(images/bg-section.gif) repeat-x top left;
height: 193px;
margin: 0;
padding: 35px 0 0 40px;
width: 186px;
}
#body .body .section img {
display: block;
}
#body .body .section a {
color: #2a4f5e;
display: block;
font-size: 14px;
font-weight: bold;
height: 145px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
width: 145px;
}
#body .body .section a:hover {
color: #507685;
}
#body .body .section img {
border: 0;
}
#body .body .article {
background: url(images/bg-article.gif) no-repeat top center;
overflow: hidden;
padding: 19px 16px;
width: 470px;
}
#body .body .article img {
border: 0;
float: left;
padding: 0 10px 0 0;
}
#body .body .article h4 {
color: #2a4f5e;
font-size: 15px;
font-weight: bold;
margin: 12px 0;
padding: 0;
}
#body .body .article h4 a {
color: #2a4f5e;
text-decoration: none;
}
#body .body .article h4 a:hover {
color: #507685;
}
#body .body .article p {
color: #2a4f5e;
font-size: 14px;
line-height: 22px;
margin: 0;
padding: 0;
}
#body .body .article p a {
color: #2a4f5e;
}
#body .body .article p a:hover {
color: #346b84;
}
#body .footer {
margin: 0 auto;
overflow: hidden;
padding: 0 0 15px 0;
width: 960px;
}
#body .footer div {
float: left;
margin: 0;
padding: 0;
}
#body .footer div ul {
margin: 0;
padding: 0;
}
#body .footer div ul li {
list-style: none;
margin: 0 0 15px;
padding: 0 0 15px;
}
#body .footer h3 {
color: #2a4f5e;
font-size: 14px;
line-height: 26px;
margin: 0 0 12px 0;
padding: 0;
text-align: justify;
text-transform: uppercase;
}
#body .footer h3 a {
color: #2a4f5e;
text-decoration: none;
}
#body .footer h3 a:hover {
color: #507685;
}
#body .footer .section {
padding: 0 10px;
width: 220px;
}
#body .footer ul li {
background: url(images/border-dashed.gif) repeat-x bottom left;
}
#body .footer ul li:last-child {
background: none;
}
#body .footer li p {
color: #5d5d5d;
font-size: 14px;
line-height: 20px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .footer li p a {
color: #5d5d5d;
text-decoration: underline;
}
#body .footer li p a:hover {
color: #aeaeae;
}
#body .footer li span {
color: #aeaeae;
display: block;
font-size: 10px;
line-height: 16px;
margin: 5px 0 0;
padding:0;
}
#body .footer ul.news li p {
background: url(images/bullets.gif) no-repeat 0 8px;
padding: 0 0 0 15px;
}
#body .footer .featured {
padding: 0 18px 0 24px;
width: 438px;
}
#body .footer .featured ul li {
overflow: hidden;
}
#body .footer .featured img {
border: 1px solid #dbddde;
float: left;
margin: 0 20px 0 0;
padding: 1px;
}
#body .footer .featured p {
margin: 0;
padding: 0;
}
#body .contact,
#body .about,
#body .services,
#body .blog {
margin: 0 auto;
padding: 25px 10px 50px 10px;
width: 940px;
}
#body h1 {
color: #2a4f5e;
font-size: 27px;
font-weight: bold;
height: 74px;
line-height: 74px;
margin: 0;
padding: 0;
text-indent: 10px;
text-transform: uppercase;
}
#body .contact p {
color: #7b7b7b;
font-size: 15px;
font-weight: bold;
line-height: 26px;
margin: 0;
padding: 40px 0;
text-align: justify;
width: 830px;
}
#body .contact p a {
color: #7b7b7b;
}
#body .contact p a:hover {
color: #2a4f5e;
}
#body .contact div {
margin: 0;
padding: 0 0 30px 0;
}
#body .contact div h3 {
color: #5d5d5d;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 0 0 5px 0;
}
#body .contact div ul {
margin: 0;
padding: 0 0 20px 0;
}
#body .contact div ul li {
color: #5d5d5d;
font-size: 14px;
list-style: none;
margin: 0;
padding: 5px 0;
}
#body .about div {
padding: 50px 0 0 0;
}
#body .about h2 {
color: #2a4f5e;
font-size: 16px;
font-weight: bold;
margin: 0;
padding: 0;
text-transform: uppercase;
}
#body .about p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 10px 0 0;
padding: 0;
text-align: justify;
width: 830px;
}
#body .about p a {
color: #5d5d5d;
}
#body .about p a:hover {
color: #2a4f5e;
}
#body .services div {
overflow: hidden;
margin: 0;
padding: 40px 0 0;
}
#body .services h2 {
color: #2a4f5e;
font-size: 16px;
font-weight: bold;
line-height: 24px;
margin: 0;
padding: 0;
text-transform: uppercase;
}
#body .services h2 a {
color: #2a4f5e;
}
#body .services h2 a:hover {
color: #507685;
}
#body .services h3 {
color: #2a4f5e;
font-size: 14px;
font-weight: bold;
line-height: 24px;
margin: 15px 0 0;
padding: 0 30px 0 0;
text-transform: uppercase;
}
#body .services h3 a {
color: #2a4f5e;
}
#body .services h3 a:hover {
color: #507685;
}
#body .services h4 {
color: #2a4f5e;
font-size: 16px;
font-weight: normal;
line-height: 24px;
margin: 0;
padding: 0;
text-transform: uppercase;
}
#body .services p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
}
#body .services p a {
color: #5d5d5d;
}
#body .services p a:hover {
color: #2a4f5e;
}
#body .services div ul {
float: left;
margin: 0;
padding: 20px 0 0;
width: 312px;
}
#body .services div ul li {
background: url(images/bullets.gif) no-repeat center left;
color: #5d5d5d;
font-size: 14px;
list-style: none;
margin: 0;
padding: 5px 0 5px 12px;
text-align: left;
}
#body .services div div {
overflow: hidden;
margin: 0;
padding: 0 0 5px 0;
}
#body .services div div img {
float: left;
padding: 0 10px 0 0;
}
#body .services div div p {
padding: 0 30px 0 0;
text-align: justify;
}
#body .products {
margin: 0 auto;
padding: 25px 0 70px 0;
width: 960px;
}
#body .products h2 {
color: #2a4f5e;
font-size: 26px;
margin: 0;
text-align: center;
text-transform: uppercase;
padding: 90px 0 30px 0;
}
#body .products p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 0;
padding: 0 10px;
text-align: justify;
}
#body .products p a {
color: #5d5d5d;
}
#body .products p a:hover {
color: #2a4f5e;
}
#body .products div {
overflow: hidden;
margin: 0 0 45px 0;
padding: 0;
}
#body .products div div {
float: left;
margin: 0;
padding: 0 10px;
text-align: center;
width: 300px;
}
#body .products div div h3 {
color: #2a4f5e;
font-size: 16px;
line-height: 24px;
margin: 0;
padding: 0 0 10px 0;
text-align: justify;
text-transform: uppercase;
}
#body .products div p {
font-size: 16px;
}
#body .products div div p {
font-size: 14px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog {
overflow: hidden;
}
#body .blog div {
float: left;
padding: 60px 0 0 0;
width: 630px;
}
#body .blog ul {
float: left;
margin: 0;
padding: 38px 0 0 30px;
width: 280px;
}
#body .blog ul li {
background: url(images/border-dashed.gif) repeat-x bottom left;
list-style: none;
margin: 0;
padding: 22px 0;
}
#body .blog ul li:last-child {
background: none;
}
#body .blog h2 {
color: #2a4f5e;
font-size: 16px;
margin: 0;
padding: 0;
text-transform: capitalize;
}
#body .blog h3 {
color: #5d5d5d;
font-size: 14px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog h3 a {
color: #5d5d5d;
}
#body .blog h3 a:hover {
color: #2a4f5e;
}
#body .blog p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog p a {
color: #5d5d5d;
}
#body .blog p a:hover {
color: #2a4f5e;
}
#body .blog div p {
padding: 15px 0;
}
#body .blog div p.article {
font-weight: bold;
}
#footer {
background: #f5f5f5 url(images/bg-footer.gif) repeat-x top left;
margin: 0;
min-width: 960px;
padding: 0;
}
#footer div {
margin: 0 auto;
overflow: hidden;
padding: 26px 0 0;
width: 960px;
}
#footer div div {
float: left;
margin: 0;
padding: 0;
text-align: center;
width: 192px;
}
#footer div div h3 {
color: #818a8c;
font-size: 12px;
font-weight: bold;
margin: 0 0 5px 0;
padding: 0;
text-transform: uppercase;
}
#footer div div ul,
#footer div div ul li {
margin: 0;
list-style: none;
padding: 0;
}
#footer div div ul li {
font-size: 12px;
line-height: 22px;
color: #818a8c;
}
#footer div a.facebook,
#footer div a.twitter {
display: block;
float: left;
height: 27px;
margin: 10px 0 0;
text-indent: -99999em;
width: 40px;
}
#footer div a.facebook,
#footer div a.twitter {
background: url(images/icons.gif) no-repeat;
}
#footer div a.facebook {
background-position: 0 0;
margin: 10px 0 0 58px;
_margin: 10px 0 0 28px;
}
#footer div a.twitter {
background-position: 0 -37px;
}
#footer div p {
color: #c1c1c1;
font-size: 12px;
margin: 0;
padding: 0 0 30px 0;
text-align: center;
text-shadow: 1px 1px 1px #fff;
}
My other CSS to overwrite.
/*
Document : login
Created on : Nov 15, 2012, 2:15:26 PM
Author : god-gavedmework
Description:
Purpose of the stylesheet follows.
*/
.overlap{
background:none;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
table
{
position:absolute;
width: 20%;
float: left;
}
.errorMessage {
color: red;
font-size: 0.8em;
}
You could try to use the visibility hidden that way it will take the same space but will be invisible
.overlap{
background:none;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
visibility:hidden;
}
#body .header #prodoverlap{
background:none;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
Please add this css code in your other CSS file
Thanks.
Check this website My Html. When you hover to product, the menu will move down.. But how can you make the drop down appear without moving anything?Like the dropdown menu is on top and not inserted in between? Sorry but I am just a newbie to this..
Thanks.
My Html Code
<!DOCTYPE html>
<!-- Template by freewebsitetemplates.com -->
<html>
<head>
<meta charset="utf-8" />
<title>LotMovement</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
</head>
<body>
<div id="header">
<div id="logo">
<img src="images/logo.jpg" alt="" />
</div>
<nav>
<ul>
<li class="selected"><span>home</span></li>
<li>
<span>Product </span>
<ul>
<li>
Input
</li>
<li>
Enquiry
</li>
</ul>
</li>
<li><span>Movement</span></li>
<li><span>contact us</span></li>
</ul>
</nav>
</div>
<div id="body">
<div class="header">
<div>
<ul>
<li><img src="images/discuss.jpg" alt="" /></li>
<li><img src="images/graph.jpg" alt="" /></li>
</ul>
<div>
<h3>Lot Movement Tracking System</h3>
<form>
User Name
Pass Pasword
</form>
</div>
</div>
</div>
</div>
<div id="footer">
<div>
<div>
<h3>AusTralAsia</h3>
<ul>
<ul>
<li>+630212013129 -Main</li>
</ul>
</ul>
</div>
<div>
<h3>europe</h3>
<ul>
<li>To Be Announced</li>
</ul>
</div>
<div>
<h3>canada</h3>
<ul>
<li>To Be Announced</li>
<li></li>
</ul>
</div>
<div>
<h3>middle east</h3>
<ul>
<li>To Be Announced</li>
<li></li>
</ul>
</div>
<div>
<h3>follow us:</h3>
<a class="facebook" href="http://www.facebook.com/" target="_blank">facebook</a>
<a class="twitter" href="http://twitter.com" target="_blank">twitter</a>
</div>
</div>
<div>
<p>© Copyright 2012. All rights reserved</p>
</div>
</div>
</body>
</html>
My CSS
/* Template by freewebsitetemplates.com */
body {
font-family: Arial, Helvetica, sans-serif;
margin:0;
padding: 0;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
#body {
background: url(images/bg-content.gif) repeat-x top left;
margin: 0;
padding: 0;
min-width: 960px;
}
#body .header {
background: url(images/bg-body.gif) repeat-x bottom center;
margin: 0 0 30px 0;
}
#body .header div {
background: url(images/smiling-man.jpg) no-repeat bottom right;
height: 472px;
margin: 0 auto;
padding: 0;
width: 960px;
}
#body .header div div {
background: none;
margin: 0;
padding: 0 0 0 13px;
height: 200px;
width: 490px;
}
#body .header div h3 {
color: #2a4f5e;
font-size: 20px;
line-height: 30px;
margin: 18px 0 0 0;
padding: 0;
text-shadow: 1px 1px 1px #fff;
}
#body .header div h3 span {
display: block;
font-size: 25px;
}
#body .header div h3 a {
color: #2a4f5e;
text-decoration: none;
}
#body .header div h3 a:hover {
color: #507685;
}
#body .header div p {
color: #507685;
font-size: 14px;
line-height: 24px;
margin: 12px 0 6px 0;
padding: 0;
text-shadow: 1px 1px 1px #fff;
}
#body .header div p a {
color: #507685;
}
#body .header div p a:hover {
color: #2a4f5e;
}
#body .header ul {
overflow: hidden;
margin: 0;
padding: 49px 0 0;
}
#body .header ul li {
float: left;
list-style: none;
padding: 0 5px;
}
#body .body {
border: 1px solid #e0e0e0;
margin: 0 auto 34px auto;
overflow: hidden;
padding: 0 2px;
width: 954px;
}
#body .body div {
float: left;
}
#body .body .section {
background: url(images/bg-section.gif) repeat-x top left;
height: 193px;
margin: 0;
padding: 35px 0 0 40px;
width: 186px;
}
#body .body .section img {
display: block;
}
#body .body .section a {
color: #2a4f5e;
display: block;
font-size: 14px;
font-weight: bold;
height: 145px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
width: 145px;
}
#body .body .section a:hover {
color: #507685;
}
#body .body .section img {
border: 0;
}
#body .body .article {
background: url(images/bg-article.gif) no-repeat top center;
overflow: hidden;
padding: 19px 16px;
width: 470px;
}
#body .body .article img {
border: 0;
float: left;
padding: 0 10px 0 0;
}
#body .body .article h4 {
color: #2a4f5e;
font-size: 15px;
font-weight: bold;
margin: 12px 0;
padding: 0;
}
#body .body .article h4 a {
color: #2a4f5e;
text-decoration: none;
}
#body .body .article h4 a:hover {
color: #507685;
}
#body .body .article p {
color: #2a4f5e;
font-size: 14px;
line-height: 22px;
margin: 0;
padding: 0;
}
#body .body .article p a {
color: #2a4f5e;
}
#body .body .article p a:hover {
color: #346b84;
}
#body .footer {
margin: 0 auto;
overflow: hidden;
padding: 0 0 15px 0;
width: 960px;
}
#body .footer div {
float: left;
margin: 0;
padding: 0;
}
#body .footer div ul {
margin: 0;
padding: 0;
}
#body .footer div ul li {
list-style: none;
margin: 0 0 15px;
padding: 0 0 15px;
}
#body .footer h3 {
color: #2a4f5e;
font-size: 14px;
line-height: 26px;
margin: 0 0 12px 0;
padding: 0;
text-align: justify;
text-transform: uppercase;
}
#body .footer h3 a {
color: #2a4f5e;
text-decoration: none;
}
#body .footer h3 a:hover {
color: #507685;
}
#body .footer .section {
padding: 0 10px;
width: 220px;
}
#body .footer ul li {
background: url(images/border-dashed.gif) repeat-x bottom left;
}
#body .footer ul li:last-child {
background: none;
}
#body .footer li p {
color: #5d5d5d;
font-size: 14px;
line-height: 20px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .footer li p a {
color: #5d5d5d;
text-decoration: underline;
}
#body .footer li p a:hover {
color: #aeaeae;
}
#body .footer li span {
color: #aeaeae;
display: block;
font-size: 10px;
line-height: 16px;
margin: 5px 0 0;
padding:0;
}
#body .footer ul.news li p {
background: url(images/bullets.gif) no-repeat 0 8px;
padding: 0 0 0 15px;
}
#body .footer .featured {
padding: 0 18px 0 24px;
width: 438px;
}
#body .footer .featured ul li {
overflow: hidden;
}
#body .footer .featured img {
border: 1px solid #dbddde;
float: left;
margin: 0 20px 0 0;
padding: 1px;
}
#body .footer .featured p {
margin: 0;
padding: 0;
}
#body .contact,
#body .about,
#body .services,
#body .blog {
margin: 0 auto;
padding: 25px 10px 50px 10px;
width: 940px;
}
#body h1 {
color: #2a4f5e;
font-size: 27px;
font-weight: bold;
height: 74px;
line-height: 74px;
margin: 0;
padding: 0;
text-indent: 10px;
text-transform: uppercase;
}
#body .contact p {
color: #7b7b7b;
font-size: 15px;
font-weight: bold;
line-height: 26px;
margin: 0;
padding: 40px 0;
text-align: justify;
width: 830px;
}
#body .contact p a {
color: #7b7b7b;
}
#body .contact p a:hover {
color: #2a4f5e;
}
#body .contact div {
margin: 0;
padding: 0 0 30px 0;
}
#body .contact div h3 {
color: #5d5d5d;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 0 0 5px 0;
}
#body .contact div ul {
margin: 0;
padding: 0 0 20px 0;
}
#body .contact div ul li {
color: #5d5d5d;
font-size: 14px;
list-style: none;
margin: 0;
padding: 5px 0;
}
#body .about div {
padding: 50px 0 0 0;
}
#body .about h2 {
color: #2a4f5e;
font-size: 16px;
font-weight: bold;
margin: 0;
padding: 0;
text-transform: uppercase;
}
#body .about p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 10px 0 0;
padding: 0;
text-align: justify;
width: 830px;
}
#body .about p a {
color: #5d5d5d;
}
#body .about p a:hover {
color: #2a4f5e;
}
#body .services div {
overflow: hidden;
margin: 0;
padding: 40px 0 0;
}
#body .services h2 {
color: #2a4f5e;
font-size: 16px;
font-weight: bold;
line-height: 24px;
margin: 0;
padding: 0;
text-transform: uppercase;
}
#body .services h2 a {
color: #2a4f5e;
}
#body .services h2 a:hover {
color: #507685;
}
#body .services h3 {
color: #2a4f5e;
font-size: 14px;
font-weight: bold;
line-height: 24px;
margin: 15px 0 0;
padding: 0 30px 0 0;
text-transform: uppercase;
}
#body .services h3 a {
color: #2a4f5e;
}
#body .services h3 a:hover {
color: #507685;
}
#body .services h4 {
color: #2a4f5e;
font-size: 16px;
font-weight: normal;
line-height <ul>
A 0;
padding: 0;
text-transform: uppercase;
}
#body .services p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
}
#body .services p a {
color: #5d5d5d;
}
#body .services p a:hover {
color: #2a4f5e;
}
#body .services div ul {
float: left;
margin: 0;
padding: 20px 0 0;
width: 312px;
}
#body .services div ul li {
background: url(images/bullets.gif) no-repeat center left;
color: #5d5d5d;
font-size: 14px;
list-style: none;
margin: 0;
padding: 5px 0 5px 12px;
text-align: left;
}
#body .services div div {
overflow: hidden;
margin: 0;
padding: 0 0 5px 0;
}
#body .services div div img {
float: left;
padding: 0 10px 0 0;
}
#body .services div div p {
padding: 0 30px 0 0;
text-align: justify;
}
#body .products {
margin: 0 auto;
padding: 25px 0 70px 0;
width: 960px;
}
#body .products h2 {
color: #2a4f5e;
font-size: 26px;
margin: 0;
text-align: center;
text-transform: uppercase;
padding: 90px 0 30px 0;
}
#body .products p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 0;
padding: 0 10px;
text-align: justify;
}
#body .products p a {
color: #5d5d5d;
}
#body .products p a:hover {
color: #2a4f5e;
}
#body .products div {
overflow: hidden;
margin: 0 0 45px 0;
padding: 0;
}
#body .products div div {
float: left;
margin: 0;
padding: 0 10px;
text-align: center;
width: 300px;
}
#body .products div div h3 {
color: #2a4f5e;
font-size: 16px;
line-height: 24px;
margin: 0;
padding: 0 0 10px 0;
text-align: justify;
text-transform: uppercase;
}
#body .products div p {
font-size: 16px;
}
#body .products div div p {
font-size: 14px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog {
overflow: hidden;
}
#body .blog div {
float: left;
padding: 60px 0 0 0;
width: 630px;
}
#body .blog ul {
float: left;
margin: 0;
padding: 38px 0 0 30px;
width: 280px;
}
#body .blog ul li {
background: url(images/border-dashed.gif) repeat-x bottom left;
list-style: none;
margin: 0;
padding: 22px 0;
}
#body .blog ul li:last-child {
background: none;
}
#body .blog h2 {
color: #2a4f5e;
font-size: 16px;
margin: 0;
padding: 0;
text-transform: capitalize;
}
#body .blog h3 {
color: #5d5d5d;
font-size: 14px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog h3 a {
color: #5d5d5d;
}
#body .blog h3 a:hover {
color: #2a4f5e;
}
#body .blog p {
color: #5d5d5d;
font-size: 14px;
line-height: 24px;
margin: 0;
padding: 0;
text-align: justify;
}
#body .blog p a {
color: #5d5d5d;
}
#body .blog p a:hover {
color: #2a4f5e;
}
#body .blog div p {
padding: 15px 0;
}
#body .blog div p.article {
font-weight: bold;
}
#footer {
background: #f5f5f5 url(images/bg-footer.gif) repeat-x top left;
margin: 0;
min-width: 960px;
padding: 0;
}
#footer div {
margin: 0 auto;
overflow: hidden;
padding: 26px 0 0;
width: 960px;
}
#footer div div {
float: left;
margin: 0;
padding: 0;
text-align: center;
width: 192px;
}
#footer div div h3 {
color: #818a8c;
font-size: 12px;
font-weight: bold;
margin: 0 0 5px 0;
padding: 0;
text-transform: uppercase;
}
#footer div div ul,
#footer div div ul li {
margin: 0;
list-style: none;
padding: 0;
}
#footer div div ul li {
font-size: 12px;
line-height: 22px;
color: #818a8c;
}
#footer div a.facebook,
#footer div a.twitter {
display: block;
float: left;
height: 27px;
margin: 10px 0 0;
text-indent: -99999em;
width: 40px;
}
#footer div a.facebook,
#footer div a.twitter {
background: url(images/icons.gif) no-repeat;
}
#footer div a.facebook {
background-position: 0 0;
margin: 10px 0 0 58px;
_margin: 10px 0 0 28px;
}
#footer div a.twitter {
background-position: 0 -37px;
}
#footer div p {
color: #c1c1c1;
font-size: 12px;
margin: 0;
padding: 0 0 30px 0;
text-align: center;
text-shadow: 1px 1px 1px #fff;
}
Try adding position: absolute; property to the ul element:
nav ul ul {
display: none;
}
nav ul li:hover > ul {
position: absolute;
display: block;
}