Hi, I have just agreed to do a site for my mum and after a few years break from any web design I find that the new way to do things is using CSS.
Things were going ok until I try to add a footer to my site that hugs the bottom of the page and sits below the content. I get the bar to appear but its floats half way down the left floated column in the main section below the text.
I am hoping that I am missing something obvious. I have included code below. I apologise if its a bit scrappy a combination of me learning and having messed around to try and get this working.
body {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
text-align: center;
min-height: 100%;
}
html, body {
height: 100%;
}
div#wrapper {
position: relative;
width: 800px;
min-height: 100%;
height:100%;
background-color:#FFFFFF;
margin: 0 auto;
padding: 0px;
}
* html #wrapper {
height: 100%;
}
div#header {
padding: 0px;
margin: 0px;
text-align: left;
}
div#navbar {
display: table;
height: 20px;
width: 800px;
text-align: right;
background-color: #d10e2c;
padding: 0;
margin:0 auto;
}
* html div#navbar {
display:inline-block;
width: 800px;
padding:0 2px;
}
div#navbar ul {
margin: 0;
padding: 0;
font-size: medium;
color: #FFF;
line-height: 20px;
white-space: nowrap;
}
div#navbar li {
list-style-type: none;
display: inline-block;
display; table-cell;
}
* html div#navbar li {
display:inline;
}
div#navbar li a {
display: block;
text-decoration: none;
padding: 7px 10px;
color: #FFF;
text-align: center;
border-left: solid #FFF 2px;
margin:0 -2px;
}
* html div#navbar a {
display:inline-block;
margin:0 -2px;
}
div#navbar li a:link {
color: #FFF;
}
div#navbar li a:visited {
color: #FFF;
}
div#navbar li a:hover {
color: #FFF;
background-color:#8662b3;
}
div#leftbar {
width: 15%;
padding: 0px;
margin-top: 15px;
float: left;
text-align: left;
padding-bottom: 30px;
}
div#main {
margin-left: 17%;
margin-top: 1px;
padding: 0px;
text-align: justify;
padding-bottom: 30px;
}
div#footer {
clear: both;
position: absolute;
bottom: 0;
width: 100%;
height: 30px;
background: #6cf;
text-align: center;
}
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Jacqui Atkin - Home</title>
<meta name="generator" content="Amaya, see http://www.w3.org/Amaya/" />
<link href="Basic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<img alt="" src="Title.png" />
<div id="navbar">
<ul>
<li><a href="Home.html">Home </a></li>
<li><a href="Gallery.html">Gallery </a></li>
<li><a href="Contact.html">Contact </a></li>
<li><a href="Outlets.html">Outlets </a></li>
</ul>
</div>
</div>
<div id="leftbar">
<img alt="" src="sb2.png" />
</div>
<div id="main">
<p> some text </p>
</div>
<div id="footer"></div>
</div>
</body>
</html>
Thanks.