Click here to Skip to main content
16,006,013 members
Home / Discussions / Web Development
   

Web Development

 
Questionxhtml and footers Pin
Jeremy Falcon16-Dec-06 4:26
professionalJeremy Falcon16-Dec-06 4:26 
AnswerRe: xhtml and footers Pin
Bradml16-Dec-06 5:30
Bradml16-Dec-06 5:30 
GeneralRe: xhtml and footers Pin
Jeremy Falcon16-Dec-06 10:23
professionalJeremy Falcon16-Dec-06 10:23 
GeneralRe: xhtml and footers Pin
Guffa16-Dec-06 12:01
Guffa16-Dec-06 12:01 
GeneralRe: xhtml and footers Pin
Jeremy Falcon16-Dec-06 12:19
professionalJeremy Falcon16-Dec-06 12:19 
GeneralRe: xhtml and footers Pin
Bradml16-Dec-06 23:32
Bradml16-Dec-06 23:32 
GeneralRe: xhtml and footers Pin
Jeremy Falcon17-Dec-06 6:09
professionalJeremy Falcon17-Dec-06 6:09 
GeneralRe: xhtml and footers [modified] Pin
Bradml18-Dec-06 5:41
Bradml18-Dec-06 5:41 
Hey Jeremy.

I'm sorry for the lateness of this reply but I have been flat out the past couple days.

Anyway I took a look and the page there and quickly reconstucted it so i could make sure i knew exactly what it was doing (PS. The footer breaks in Dreamweaver!).

Ok here is the CSS:

<style type="text/css">
<!--
/*This will make sure that the entire window space is utilized. 
Without it the footer would not take up the entire width and would not be at the base of the document. */

html, body, #container {
	min-height: 100%;
	width: 100%;
	height: 100%;
}

/*This is hack to stop firefox from displaying a scroll bar. 
IE 5 for Windows will not read this because of the "html>body" thing. */
html>body, html>body #container{
height:auto;
}

/*Formating and removing margins*/
body{
font-family:Arial, Helvetica, sans-serif;
margin:0;
}

/*Setting the page containers start position (This container takes up the entire document) */
#container{
position:absolute;
top:0px;
left:0px;

}

/*The footer is placed at the bottom left with a width of 100%. 
I have not used the box model hack because I have removed its borders and padding. */
#footer{
position:absolute;
left:0px;
bottom:0px;
width:100%;
background-color:#FFFF00;

border:0px;
padding:0px;
}

/*The "margin-bottom:" stops the document from becoming small enough for an overlap to occur. 
Note that if you have multiple lines you may have to increase this. */
#content{
margin-bottom: 4em; 
height: auto;
padding: .5em;
}

/*and that is that*/
-->
</style>


So that is pretty much how that all works...

This page is an example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Page with Footer!</title>
<style type="text/css">
<!--
html, body, #container {
	min-height: 100%;
	width: 100%;
	height: 100%;
}


html>body, html>body #container{
height:auto;
}

body{
font-family:Arial, Helvetica, sans-serif;
margin:0;
}
#container{
position:absolute;
top:0px;
left:0px;

}

#footer{
position:absolute;
left:0px;
bottom:0px;
width:100%;
background-color:#FFFF00;
border-top:2em;
height:auto;
}
#content{
margin-bottom: 4em; 
height: auto;
padding: .5em;
}

-->
</style>
</head>

<body>
<div id="container">
<div id="content">
This is page content.
It could contain many many many lines of code!
<br />
This is even more content!<br />
And so is this!!
</div>
	
<div id="footer">
This is a footer!!! <i>Brads amazing facts #451254</i>
<br />
More!!
</div>
</div>
</body>
</html>


I wonder if I should consider writing an article on this sort of thing....
What do you think?






-- modified at 11:46 Monday 18th December, 2006



Brad
Australian

"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen

GeneralRe: xhtml and footers Pin
Jeremy Falcon18-Dec-06 6:16
professionalJeremy Falcon18-Dec-06 6:16 
GeneralRe: xhtml and footers Pin
Jeremy Falcon18-Dec-06 6:21
professionalJeremy Falcon18-Dec-06 6:21 
GeneralRe: xhtml and footers Pin
Bradml18-Dec-06 18:42
Bradml18-Dec-06 18:42 
GeneralRe: xhtml and footers Pin
Bradml18-Dec-06 18:48
Bradml18-Dec-06 18:48 
GeneralRe: xhtml and footers Pin
Jeremy Falcon19-Dec-06 4:07
professionalJeremy Falcon19-Dec-06 4:07 
GeneralRe: xhtml and footers Pin
Jeremy Falcon19-Dec-06 4:08
professionalJeremy Falcon19-Dec-06 4:08 
GeneralRe: xhtml and footers Pin
S Douglas19-Mar-07 1:29
professionalS Douglas19-Mar-07 1:29 
GeneralRe: xhtml and footers Pin
Bradml19-Mar-07 1:33
Bradml19-Mar-07 1:33 
GeneralRe: xhtml and footers Pin
S Douglas19-Mar-07 3:40
professionalS Douglas19-Mar-07 3:40 
GeneralRe: xhtml and footers Pin
JimmyRopes17-Dec-06 17:28
professionalJimmyRopes17-Dec-06 17:28 
GeneralRe: xhtml and footers Pin
Jeremy Falcon18-Dec-06 4:18
professionalJeremy Falcon18-Dec-06 4:18 
AnswerRe: xhtml and footers Pin
JimmyRopes16-Dec-06 20:16
professionalJimmyRopes16-Dec-06 20:16 
GeneralRe: xhtml and footers Pin
Bradml16-Dec-06 20:31
Bradml16-Dec-06 20:31 
GeneralRe: xhtml and footers Pin
JimmyRopes16-Dec-06 20:35
professionalJimmyRopes16-Dec-06 20:35 
GeneralRe: xhtml and footers Pin
Bradml16-Dec-06 21:40
Bradml16-Dec-06 21:40 
GeneralRe: xhtml and footers Pin
JimmyRopes16-Dec-06 22:02
professionalJimmyRopes16-Dec-06 22:02 
GeneralRe: xhtml and footers Pin
Jeremy Falcon17-Dec-06 6:00
professionalJeremy Falcon17-Dec-06 6:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.