HTML & CSS Layout Flow Issue - html

I have a flow layout with following two alignment issues
Refer Image 1: When I change the zoo, the title info overlaps the logo.
Refer Image 2: The green box should come as right side of the blue box; currently it is coming on bottom.
How can I correct it? The code is available in this fiddle . Posted here also.
I am sure it is a very basic alignment lesson; however I am not able to figure it out even after many hours? Can you please take a look at it and answer?
Image 1
Image 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<title>Support Site </title>
<link href="Styles/MasterStyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="container">
<div id="header">
<div id="logo">
<img alt="logo" src="Images/Logo.bmp" />
</div>
<div id="titleInfo">
Admin XXXXXXXX Support Site
<div id="signOut">
<a id="logOnStatus" class="signOut" >
Logout</a>
</div>
</div>
<div class="clear">
</div>
</div>
<div id="centralContainer">
<div id="leftNavContainer">
<div id="subContainerForLeftNav">
<div id="adminDiv">
<div class="backgroundButton" id="adminButton">
<p class="buttonText">
The Admin</p>
</div>
</div>
<div class="clear">
</div>
<div id="vendorDiv">
<div class="menuTextHeading">
<a class="menuText">The Management</a>
</div>
<div class="buttonAlign">
<div class="backgroundButton" id="connectivityButton">
<p class="buttonText">
Test</p>
</div>
<div class="backgroundButton" id="vendorsButton">
<p class="buttonText">
Test</p>
</div>
</div>
</div>
<div class="clear">
</div>
<div id="monitoringDiv">
<div class="menuTextHeading">
<a class="menuText">Test</a>
</div>
<div class="buttonAlign">
<div class="backgroundButton" id="transactionsButton">
<p class="buttonText">
Test</p>
</div>
<div class="backgroundButton" id="logsButton">
<p class="buttonText">
Test</p>
</div>
</div>
</div>
</div>
</div>
<div id="mainContainer">
<div id="transactionContentHolder" class="transactionContentHolder">
A
</div>
</div>
<div class="clear">
</div>
</div>
</div>
</div>
</body>
</html>
CSS
body
{
margin: 0px;
padding: 0px;
text-align: center;
background: Yellow;
}
#wrapper
{
width: 100%;
height: auto;
text-align:left;
margin: 0 auto;
/*background: #FFBA31;*/
background: #FFBA31;
}
#container
{
width: 100%;
height: auto;
margin: 0 auto;
background: white;
}
#header
{
width: 100%;
height: 70px;
background: white;
padding: 0 0 10px 0;
border:1px solid Red;
}
#titleInfo
{
font:bold 18pt Arial;
color:#2377D1;
width:80%;
height:35px;
float:right;
margin:10px 0 0 10px;
border-bottom:3px solid #fcda55;
padding: 10px 0 0 0;
display:inline;
}
#signOut
{
font:bold 9pt Arial;
float:right;
border-bottom:none;
padding: 0px 10px 0 0;
margin: 0px 0px 30px 0;
display:inline;
}
#logo
{
width:15%;
height:60px;
float:left;
margin:0 0 0 20px;
display:inline;
padding: 10px 0 30px 0;
}
#centralContainer
{
width: 100%;
height:auto;
margin: 0 auto;
background: white;
}
#leftNavContainer
{
width: 20%;
height: 700px;
/*float: left;*/
margin: 0 0 0 10px;
display: inline;
background: white;
border:1px solid Blue;
}
#subContainerForLeftNav
{
width: 190px;
height: auto;
}
#mainContainer
{
width: 75%;
height: 700px;
float: left;
margin: 0 0 0 30px;
display: inline;
background:white;
border:1px solid Green;
}
.menuText
{
font:bold 13pt Arial;
line-height:15pt;
color:#00A6B5;
}
.menuTextHeading
{
height:20px;
border-bottom:3px solid #fcda55;
padding:10px 0 10px 0;
margin:0 0 10px 0;
}
.buttonAlign
{
height:auto;
width:auto;
float: right;
padding:0 0 0 0;
margin:0 0 0 0;
}
.backgroundButton
{
width:150px;
height:86px;
display: block;
margin: 0px 0px 5px 0px;
background-image:url('../Images/ButtonBackground.bmp');
}
.buttonText
{
font:bold 15pt Arial;
line-height:18pt;
color:#ffffff;
padding:40px 15px 0 15px;
margin:0 0 0 0;
text-align:center;
}
.clear
{
clear: both;
}

see fiddle for code and demo
fiddle: http://jsfiddle.net/L3And/3/
demo: http://jsfiddle.net/L3And/3/embedded/result/
Screen Shot:

body {
margin: 0px;
padding: 0px;
text-align: center;
background: Yellow;
}
#wrapper {
width: 100%;
height: auto;
text-align: left;
margin: 0 auto;
/*background: #FFBA31;*/
background: #FFBA31;
}
#container {
width: 100%;
height: auto;
margin: 0 auto;
background: white;
}
#header {
background: none repeat scroll 0 0 white;
border: 1px solid Red;
height: 70px;
margin-bottom: 20px;
padding: 0 0 10px;
width: 100%;
}
#titleInfo {
border-bottom: 3px solid #FCDA55;
color: #2377D1;
float: right;
font: bold 18pt Arial;
height: 35px;
margin: 10px 0 0 10px;
overflow: hidden;
padding: 10px 0 0;
width: 55%;
}
#signOut {
font: bold 9pt Arial;
float: right;
border-bottom: none;
padding: 0px 10px 0 0;
margin: 0px 0px 30px 0;
display: inline;
}
#logo {
border: 1px solid orange;
float: left;
height: 32px;
margin: 03px 0 0 20px;
padding: 10px 0 30px;
width: 15%;
}
#centralContainer {
width: 100%;
height: auto;
margin: 0 auto;
background: white;
}
/*Elements within centralContainer*/
#leftNavContainer {
background: none repeat scroll 0 0 #CCCCCC;
border: 1px solid Blue;
float: left;
height: 700px;
margin: 0 0 0 10px;
width: 20%;
}
#subContainerForLeftNav {
width: 190px;
height: auto;
/*border:1px solid green;*/
}
#mainContainer {
background: none repeat scroll 0 0 white;
border: 1px solid Green;
height: 700px;
margin: 0 0 0 219px;
width: 76%;
}
.menuText {
font: bold 13pt Arial;
line-height: 15pt;
color: #00A6B5;
}
.menuTextHeading {
height: 20px;
border-bottom: 3px solid #fcda55;
padding: 10px 0 10px 0;
margin: 0 0 10px 0;
}
.buttonAlign {
height: auto;
width: auto;
float: right;
padding: 0 0 0 0;
margin: 0 0 0 0;
}
.backgroundButton {
width: 150px;
height: 86px;
display: block;
margin: 0px 0px 5px 0px;
background-image: url('../Images/ButtonBackground.bmp');
}
.buttonText {
font: bold 15pt Arial;
line-height: 18pt;
color: #ffffff;
padding: 40px 15px 0 15px;
margin: 0 0 0 0;
text-align: center;
}
.clear {
clear: both;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<title>Support Site</title>
<link href="Styles/MasterStyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="container">
<div id="header">
<div id="logo">
<img alt="logo" src="Images/Logo.bmp" />
</div>
<div id="titleInfo">
Admin XXXXXXXX Support Site
<div id="signOut">
<a id="logOnStatus" class="signOut">
Logout</a>
</div>
</div>
<div class="clear">
</div>
</div>
<div id="centralContainer">
<div id="leftNavContainer">
<div id="subContainerForLeftNav">
<div id="adminDiv">
<div class="backgroundButton" id="adminButton">
<p class="buttonText">
The Admin</p>
</div>
</div>
<div class="clear">
</div>
<div id="vendorDiv">
<div class="menuTextHeading">
<a class="menuText">The Management</a>
</div>
<div class="buttonAlign">
<div class="backgroundButton" id="connectivityButton">
<p class="buttonText">
Test</p>
</div>
<div class="backgroundButton" id="vendorsButton">
<p class="buttonText">
Test</p>
</div>
</div>
</div>
<div class="clear">
</div>
<div id="monitoringDiv">
<div class="menuTextHeading">
<a class="menuText">Test</a>
</div>
<div class="buttonAlign">
<div class="backgroundButton" id="transactionsButton">
<p class="buttonText">
Test</p>
</div>
<div class="backgroundButton" id="logsButton">
<p class="buttonText">
Test</p>
</div>
</div>
</div>
</div>
</div>
<div id="mainContainer">
<div id="transactionContentHolder" class="transactionContentHolder">
A
</div>
</div>
<div class="clear">
</div>
</div>
</div>
</div>
</body>
</html>
this might help you fiddle

Related

Inexplicable gap in between my divs

I am trying to replicate the BBC News site and I have this weird styling problem.
Here is the image.
I always get this gap in between two of my divs.
Here is the code I used. Not sure how I am supposed to go about getting rid of that space. tried setting margin and padding to 0 but that didn't work.
Here is the code:
body{
margin: 0;
padding: 0;
font-family: Helvetica, Arial, sans-serif;
}
#topbar{
height: 40px;
width: 1000px;
margin: 0 auto;
background-color: #FFFFFF;
}
#logo{
float: left;
margin-top: 8px;
margin-right: 8px;
}
.topbarsections{
float:left;
border-left: 1px #CCCCCC solid;
height: 100%;
}
#signin-image{
float: left;
width: 30px;
margin-top: 7px;
margin-left: 8px;
}
#signin-text{
float: left;
font-weight: bold;
font-size: 90%;
color: #333333;
position: relative;
top: 13px;
padding-right: 80px;
}
.topbar-menu{
float: left;
font-weight: bold;
color: #333333;
font-size: 90%;
padding: 13px 15px 0 15px;
height: 27px;
}
#more-arrow{
height: 13px;
margin-left: 15px;
}
#search-box{
background-color: #E4E4E4;
margin: 8px 0 0 10px;
border: none;
font-weight: bold;
font-size: 14px;
padding: 5px;
width: 140px;
float: left
}
#magnifying-glass{
margin-top: 8px;
height: 26px;
}
.clear{
margin: 0;
padding: 0;
}
#news-bar{
background-color: #BB1919;
width: 100%;
height: 70px;
}
#inner-news-bar{
background-color: #BB1919;
margin: 0 auto;
width: 1200px;
height: 70px;
}
#news-bar h1{
color: white;
margin: 0;
padding: 10px;
font-weight: normal;
font-size: 45px;
}
#menu-bar{
background-color: #A91717;
width: 100%;
height: 35px;
}
#inner-menu-bar{
background-color: #A91717;
width: 1200px;
height: 35px;
margin: 0 auto;
}
.menu-bar-sections{
float: left;
border-right: 1px solid #BB4545;
padding-left: 10px;
padding-right:8px;
position: relative;
top: -5px;
}
.menu-bar-sections a{
float:left;
color: white;
text-decoration: none;
}
.menu-bar-sections a:hover{
text-decoration: underline;
}
#menu-bar-more-section{
border-right: none !important;
}
#down-arrow{
float: left;
height: 13px;
position: relative;
top: 2px;
margin-left: 2px;
}
#page-container{
width: 1200px;
margin: 0 auto;
}
h2{
}
<body>
<div id="topbar">
<img id="logo" src="images/bbclogo.png">
<div id="signin-div" class="topbarsections">
<img src="images/singin.PNG" id="signin-image">
<span id="signin-text">Sign in</span>
</div>
<div class="topbarsections topbar-menu">
News
</div>
<div class="topbarsections topbar-menu">
Sports
</div>
<div class="topbarsections topbar-menu">
Weather
</div>
<div class="topbarsections topbar-menu">
Shop
</div>
<div class="topbarsections topbar-menu">
Earth
</div>
<div class="topbarsections topbar-menu">
Travel
</div>
<div class="topbarsections topbar-menu">
More
<img id="more-arrow"src="images/more-arrow.PNG">
</div>
<div class="topbarsections">
<input id="search-box" type="text" placeholder="Search">
<input type="image" id="magnifying-glass" src="images/glass.PNG">
</div>
</div>
<div class="clear"></div>
<div id="news-bar">
<div id="inner-news-bar">
<h1>NEWS</h1>
</div>
</div>
<div class="clear"></div>
<div id="menu-bar">
<div id="inner-menu-bar">
<p class="menu-bar-sections">Home</p>
<p class="menu-bar-sections">Video</p>
<p class="menu-bar-sections">World</p>
<p class="menu-bar-sections">US & Canada</p>
<p class="menu-bar-sections">UK</p>
<p class="menu-bar-sections">Business</p>
<p class="menu-bar-sections">Tech</p>
<p class="menu-bar-sections">Science</p>
<p class="menu-bar-sections">Stories</p>
<p class="menu-bar-sections">Entertainment & Arts</p>
<p class="menu-bar-sections">Health</p>
<p class="menu-bar-sections" id="menu-bar-more-section">More<img src="images/down-arrow.PNG" id="down-arrow"></p>
</div>
</div>
<div class="clear"></div>
<div id="page-container">
<div id="main-article">
<h2>Technology</h2>
</div>
</div>
</body>
If by "gap" you mean the space above the heading "Technology", #Olivier Krull is right: that's the default margin of the h2 header.
You can simply add this CSS rule to set it to zero:
#main-article > h2:first-child {
margin-top: 0;
}

External CSS files causing problems to images

This is NetBeans. I have tried to include an external CSS file but when used externally the images all get really enlarged. Whereas my I use the same styling within the html file using internal styling the images are of correct ratio.
body {
width: 100%;
height: 100%;
margin: 0;
}
.header {
background-color: #000;
color: #fff;
border-color: #080808;
min-height: 50px;
border: 1px solid transparent;
}
.inner header {
width: 80%;
margin: auto;
}
.logo {
float: left;
height: 50px;
padding: 15px;
font-size: 20px;
font-weight: bold;
padding-left: 90px;
}
a {
text-decoration: none;
background-color: transparent;
color: #ededed;
}
.header link {
float: right;
font-size: 14px;
height: 50px;
padding: 15px 15px;
font-size: 16px;
font-weight: bold;
}
#su {
float: right;
height: 50px;
padding: 15px 90px;
}
#l {
float: right;
height: 50px;
padding: 15px 0px;
}
.content {
min-height: 600px;
}
.banner-image {
padding-bottom: 50px;
margin-bottom: 20px;
text-align: center;
color: #f8f8f8;
background: url(image/intro-bg_1.jpg) no-repeat center;
background-size: cover;
}
.inner-banner-image {
padding-top: 12%;
width: 80%;
margin: auto;
}
.banner-content {
position: relative;
padding-top: 6%;
padding-bottom: 6%;
overflow: hidden;
margin-bottom: 12%;
background-color: rgba(0, 0, 0, 0.7);
max-width: 660px;
margin-left: 200px;
}
.button {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.container {
width: 90%;
margin: auto;
overflow: hidden;
}
.items {
width: 30%;
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
float: left;
margin-left: 1%;
}
.thumbnail {
display: block;
max-width: 100%;
height: auto;
}
.caption {
color: #000;
padding: 0px 10px 10px;
font-weight: bold;
text-align: center;
}
footer {
background-color: #000;
color: #fff;
font-size: 14px;
text-align: center;
}
<html>
<head>
<title>Lifestyle Store</title>
</head>
<body>
<div class="header">
<div class="inner header">
<div class="logo">
Lifestyle Store
</div>
<div class="header link">
<div id="su">
Sign Up
</div>
<div id="l">
Login
</div>
</div>
</div>
</div>
<div class="content">
<div class="banner-image">
<div class="inner-banner-image ">
<div class="banner-content">
<h1>We sell lifestyle</h1>
<p>Flat 40% OFF on premium brands</p>
<form>
Shop Now
</form>
</div>
</div>
</div>
</div>
<div class="container">
<div class="items">
<a href="#">
<img src="image/camera.jpg" class="thumbnail">
<div class="caption">
<h2>Cameras</h2>
<p>Choose among the best from the world</p>
</div>
</a>
</div>
<div class="items">
<a href="#">
<img src="image/watch.jpg" class="thumbnail">
<div class="caption">
<h2>Watches</h2>
<p>Original watches from the best brands</p>
</div>
</a>
</div>
<div class="items">
<a href="#">
<img src="image/shirt.jpg" class="thumbnail">
<div class="caption">
<h2>Shirts</h2>
<p>Our exquisite collection of shirts</p>
</div>
</a>
</div>
</div>
<footer>
<div class="container">
<p>Copyright © Lifestyle Store. All Rights Reserved | Contact Us: +91 90000 00000</p>
</div>
</footer>
</body>
</html>
Have you linked the CSS file correctly in this line? Try dragging and dropping the file directly into the HTML to ensure the location and name is correct.
href="assignment1/public_html/style.css"
Edit:
The current link you have is saying that you have the index.html file outside of the 'assignment1' folder. If you have your HTML file inside 'public_html' then the stylesheet link should be the following.
href="style.css"

A top bar on a website not floating properly on Chrome

I am creating a website and this is what it should look like:
http://i.imgur.com/PjsnVPw.png
^^ That is in Internet Explorer
But on Chrome it looks like this: http://i.imgur.com/Ga6le1y.png
As you can see the Top bar on chrome shows completely wrong
The HTML and CSS for this is
HTML
<header>
<img id="logo" src="images/logo.png" alt="Logo">
<div id="topLinks">
<div id="SoicalLinks">
<img src="images/LinkedIn.png" alt="Linkedin logo">
<img src="images/twitterico.png" alt="Twitter Logo">
</div>
<div id="PhoneNumber">
01673 862133
</div>
</div>
<nav>
<ul>
<li><a class="first" href="#">Coaching</a></li>
<li>NLP</li>
<li>Course</li>
<li>Culture Change</li>
<li>Training & Consultancy</li>
</ul>
</nav>
<div class="clear"></div>
<div id="banner">
<div id="face">
<img src="images/webface.png" alt="A side on view of a face">
</div>
<div id="fishwaterimage">
<img src="images/fishwater.png" alt="a Fish with a splash of water">
</div>
<div id="quote">
<p>"...The experience has been first class, I feel privileged to have had this opportunity. Thank you team Dexter."</p>
</div>
<div id="readmore">
<p>Read more testimonials...</p>
</div>
</div>
</header>
and the CSS for all that is
body {
background-image: url(/images/background.png); background-repeat: repeat-x;
margin: 0 auto 0 auto;
width: 1024px;
}
img #logo{
float: right;
width: 325px;
display: inline;
}
#topLinks{
margin: 0 0 0 50px;
width: 250px;
display: inline;
float: right;
}
#PhoneNumber{
padding: 15px;
color: #a7a2a5;
background-color: #000;
float: right;
}
#SoicalLinks{
float: left;
}
nav{
text-align: center;
float: right;
margin: -50px 0 0 0;
width: 600px;
}
nav ul
{
list-style-type:none;
margin:0;
padding:0;
}
nav a
{
font-size: 20px;
color: #383336;
text-decoration: none;
border-left: 1px solid #b22b8d;
display:block;
padding: 0px 10px 0 10px;
}
nav li
{
display: inline;
float: left;
}
nav ul a.first {
border-left: none;
}
#banner{
box-shadow: 1.5px 2.598px 15px 0px rgb( 0, 0, 0 );
width: 900px;
height: 248px;
margin: 0 auto 0 auto;
}
#banner #face{
float: left;
z-index: 2;
position: absolute;
}
#banner #fishwaterimage{
float: right;
margin: 0 0 0 0;
z-index: 1;
}
#banner #quote{
font-size: 26px;
float: left;
z-index: 3;
margin: 25px 0 0 25px;
color: #a7a2a5;
width: 300px;
position:absolute;
}
#banner #readmore{
font-size: 15px;
float: left;
z-index: 3;
margin: 170px 0 0 25px;
color: #a7a2a5;
width: 300px;
position:absolute;
font-style: italic;
}
Anyone with any idea why that is not showing properly in chrome and the fix.
Did you try adding position: absolute or position: relative to the nav bar?

HTML & CSS - Table attribute in CSS is behaving usual. Don't know how to fix it

I'm working on a webpage and decided to tables in CSS to create my navigation bar; all is fine until I go to the cell with email address. The cell sort of skips a column. My webpage code is below, please help.
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="template.css">
<script type="text/javascript" src="action.js"></script>
<title>Danny Wong: Portfolio</title>
</head>
<body onload="cycleImage('latestImage');">
<div id="header">
<div id="navTableContainer">
<div class="navTableRow">
<div class="navContent">
<p class="paraLogo">Danny Wong Art</p>
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Architectural Visualisation
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Envirnoment
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Design
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Character
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Digital Painting
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Development
</div>
</div>
<div class="navTableRow">
<div class="navContent">
Resume
</div>
</div>
<div class="navTableRow">
<div class="navContent">
<a href="http://dintheart.tumblr.com/">Blog<a/>
</div>
</div>
<div class="navTableRow">
<div class="navContent">
test219#gmail.com
</div>
</div>
</div>
</div>
<div id="main">
<img id="latestImage" src="" alt="image cycler" width="1000" height="600">
</div>
<div id="footer">
© 2014 Danny Wong
</div>
</body>
</html>
CSS:
#import url(http://fonts.googleapis.com/css?family=Freckle+Face);
body {
background-color: #000000;
color: #FFFFFF;
}
#header {
float: left;
background-color: tranparent;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border-width: 2px;
border: solid;
}
p.paraLogo {
font-family: "freckle face", serif;
font-size: 36px;
font-style: bold;
}
#navTableContainer {
display: table;
background-color: tranparent;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border-width: 2px;
border: dotted;
}
#navTableContainer a:hover {
color: red;
}
div.navTableRow {
display: table-row;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
div.navContent {
display: table-cell;
background-color: transparent;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border: solid;
border-width: 2px;
text-align: center;
vertical-align: middle;
}
#main {
background-color: transparent;
width: 1000px;
height: 600px;
margin: -1% auto 0 auto;
padding: 0 0 0 0;
border-width: 0;
}
#footer {
background-color: transparent;
width: 200px;
margin: 0 auto 0 auto;
border-width: 0;
}
a:visited {
color: #FFFFFF;
text-decoration: none;
}
a:link {
color: #FFFFFF;
text-decoration: underline;
}
Its really getting on my nerves, I know there are other better way and will probably use them, but I really want to find out why this is happening and it could be fixed - for future reference.
Here's how I'd do it:
HTML
<div id="header">
<ul>
<li class="paraLogo">Danny Wong Art</li>
<li>Architectural Visualisation</li>
<li>Envirnoment</li>
<li>Design
</li>
<li>Character
</li>
<li>Digital Painting</li>
<li>Development</li>
<li>Resume</li>
<li>Blog
</li>
<li> test219zgmail.com
</li>
</ul>
</div>
<div id="main">
<img id="latestImage" src="" alt="image cycler" width="1000" height="600" />
</div>
<div id="footer">© 2014 Danny Wong</div>
CSS
#import url(http://fonts.googleapis.com/css?family=Freckle+Face);
body {
background-color: #000000;
color: #FFFFFF;
}
#header {
float: left;
background-color: tranparent;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border-width: 2px;
border: solid;
}
#header li.paraLogo {
font-family:"freckle face", serif;
font-size: 36px;
font-style: bold;
padding: 1em 0;
}
#header ul {
background-color: tranparent;
list-style:none;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border-width: 2px;
border: dotted;
}
#header ul a:hover {
color: red;
}
#header li {
background-color: transparent;
width: auto;
height: auto;
margin: 0 0 0 0;
padding: 0 0 0 0;
border: solid;
border-width: 2px;
text-align: center;
vertical-align: middle;
}
#main {
background-color: transparent;
width: 1000px;
height: 600px;
margin: -1% auto 0 auto;
padding: 0 0 0 0;
border-width: 0;
}
#footer {
background-color: transparent;
width: 200px;
margin: 0 auto 0 auto;
border-width: 0;
}
a:visited {
color: #FFFFFF;
text-decoration: none;
}
a:link {
color: #FFFFFF;
text-decoration: underline;
}
Example: http://jsfiddle.net/ht5zH/2/
I know my answer will not be a big help for you, and maybe I don't understand all your needs, but I highly reccommend you to design your menu another way than with display: table;. An UL list will be easier for the HTML and CSS code.

HTML – CSS problem with DIVs

I have following HTML layout
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
margin:10px 0px 0px 0px;
font-size: 11px;
font-family: Arial,Tahoma, sans-serif;
background: #fff;
color: #444;
}
h1 {
font-size:1.5em;
font-weight: bold;
}
#container {
width: 920px;
margin: 0 auto;
background-color: red
}
#header {
border: 2px solid #ccc;
height: 80px;
}
#content{
display: block;
width: 100%
}
#left {
clear: left;
float: left;
width: 660px;
border: 2px solid #ccc;
margin:0 0 10px 0;
padding:20px;
}
#right {
position: relative;
margin: 0 5px 0 5px;
padding: 5px 0px 0px 0px;
float: right;
width: 200px;
border: 2px solid #ccc;
}
#footer {
clear: both;
border: 2px solid #ccc;
padding: 10px 0 20px 0;
margin: 20px 0 0 0;
font-size: .9em;
color: #9b9b9b;
width: 100%;
background-color: skyblue;
}
</style>
</head>
<body>
<div id="container">
<div id="header" >
<h1>Header</h1>
</div>
<div id="content">
<div id="left">
<h1>Left</h1>
</div>
<div id="right">
<h1>Right</h1>
</div>
</div>
</div>
<div id="footer">
<h1>Footer</h1>
</div>
</body>
</html>
My problem is #container doesn’t hold the #left & #right contents, it only holds #header
Please refer attached imaged to see what my intended layout is.
You can add an empty element that has 'clear:both' at the end of the container:
<div id="container">
<div id="header" >
<h1>Header</h1>
</div>
<div id="content">
<div id="left">
<h1>Left</h1>
</div>
<div id="right">
<h1>Right</h1>
</div>
<div style="clear:both"> </div>
</div>
</div>
I was able to achieve the intended result by using overflow: hidden; property
#container {
width: 920px;
margin: 0 auto;
background-color: red;
overflow: hidden;
}
Use a clearfix solution i.e.
common un-obtrusive clearfix solution