/    Sign up×
Community /Pin to ProfileBookmark

css template with divs

Hiya,

I’ve created a simple template with div’s and css. It validates fine.

My problem is that the footer overlaps the other div’s.

How can I get my footer to stay at the bottom and not overlap everything?

Please help

Wayne

The Code (Sorry I don’t have any direct links yet)


——————-

html – template.html
——————-

<html>
<head>
<title>test template</title>
<link href=”css/style.css” rel=”stylesheet” type=”text/css” />
</head>

<body>

<div class=”container”>

<div class=”header”>
header
</div>

<div class=”nav”>
nav
</div>

<div class=”contents”>
contents
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>

<div class=”footer”>
footer
</div>

</div>

</body>
</html>


——————-

css – style.css
——————-

/* CSS Document */

body {
margin:0 auto;
text-align:center;
}

.container {
margin:0 auto;
width:660px;
text-align:left;
}

.header {
height:100px;
width:650px;
position:absolute; top:0px;
border:1px;
border-style:solid;
border-color:#000000;
}

.nav {
height:300px;
width:150px;
position:absolute; top:110px;
border:1px;
border-style:solid;
border-color:#000000;
}

.contents {
margin-left:160px;
height:auto;
width:490px;
position:absolute; top:110px;
border:1px;
border-style:solid;
border-color:#000000;
}

.footer {
height:50px;
width:650px;
position:absolute; bottom:0px;
border:1px;
border-style:solid;
border-color:#000000;
}

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@CentauriJun 13.2007 — simple : [B]DON'T[/B] use absolute positioning for everything
Copy linkTweet thisAlerts:
@liccyJun 14.2007 — use "float" instead absolute......try to get more info about when to use position...I think u using it too much.
×

Success!

Help @fuzecx 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...