hi guys
I'm just posting a new thread to ask if there is a way to make a div tag stick to the bottom.
this code worked at the start:
Code:
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<style>
.content1 {
border: 1px solid #CCC;
width: 44%;
margin-left: 10px;
float: left;
padding: 10px;
}
.tail {
position: absolute;
text-align: center;
width: 99%;
height: 20px;
padding: 5px;
background: rgb(230, 230, 230);
bottom: 0%;
}
</style>
<body>
<div class="content1">
<p>This is div tag class content1</p>
<p> </p>
</div>
<div class="tail">
this is the div tag class is tail
</div>
</body>
</html>
The bottom: 0%; bit made the tail div tag stick to the bottom no matter what the screen res. But as this site is dynamic, the content1 tag changes and it may get longer than a page. If so, the tail div does not stick to the bottom.
This is an example of that:
Code:
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<style>
.content1 {
border: 1px solid #CCC;
width: 44%;
margin-left: 10px;
float: left;
padding: 10px;
}
.tail {
position: absolute;
text-align: center;
width: 99%;
height: 20px;
padding: 5px;
background: rgb(230, 230, 230);
bottom: 0%;
}
</style>
<body>
<div class="content1">
<p>This is div tag class content1</p>
<p>askldjfas
alksdjfsa
a;sikjfd
a;lksjdf
;akjsdf </p>
<p>a;dskjf</p>
<p>as;kdfj</p>
<p>aklsjdf</p>
<p>sadklfj</p>
<p>as;ldfj</p>
<p>'alksjfd</p>
<p>fds</p>
<p> </p>
<p>a;lksdjf</p>
<p> </p>
<p> </p>
<p> </p>
<p>a'kajfd</p>
<p> </p>
<p> </p>
<p> </p>
<p>a;skdjf</p>
<p> </p>
<p>a\s;dkflj</p>
<p>a'lksfd</p>
</div>
<div class="tail">
this is the div tag class is tail
</div>
</body>
</html>
What CSS would I use to make the tail div tag stick to the bottom of the page no matter what the screen size or browser?
Help would be very much appreciated