/    Sign up×
Community /Pin to ProfileBookmark

CSS Footer!?

Every walkthrough about CSS and Footers deal with the browser height for positioning. I’m working on a layout, the header will have a fixed height. The body or where the content stored, will have an auto height. This height will be determine by how much content is placed. I want the footer to be at the bottom of all the content. Not the bottom of the browser window.

Thanks!

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@cbVisionJun 01.2010 — Well that's about the simplest solution!

[CODE]<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Title</title>
<meta name="language" content="en" />

<meta name="description" content="" />

<meta name="keywords" content="" />
<style type="text/css">
#header {height: 150px; background: #ddd;}
#content {background: #f2f2f2;}
#footer {height: 150px; background: #eee;}
</style>
<script type="text/javascript">
//<![CDATA[

//]]>
</script>
</head>
<body>
<div id="header">
<h1>Header</h1>
</div>
<div id="content">
<h2>Content</h2>
<p>Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. Paragraph. </p>
</div>
<div id="footer">
<h2>Footer</h2>
</div>
</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@sw0rdzauthorJun 02.2010 — Thankyou! I figure out what the problem was, and it was dealing with embedding divs and floats. I did a br with a clear, and your mechanism worked great! Thanks!
×

Success!

Help @sw0rdz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...