Solved

How to get footer on bottom?

Posted on 2011-09-08
4
170 Views
Last Modified: 2012-05-12
In the code snippet, how do I get the footer on the bottom of the page and centered?

Also, how do I get everything to stay in the middle of the page, except the footer, which will expand all the way across?
<html>
<head></head>
<body>
<div>top div here</div>

<div style="float:left;text-align:center;width:200;height:200px;border:1px solid black;padding:10px;margin:10px;">box 1</div>
<div style="float:left;text-align:center;width:200;height:200px;border:1px solid black;padding:10px;margin:10px;">box 2</div>
<div style="float:left;text-align:center;width:200;height:200px;border:1px solid black;padding:10px;margin:10px;">box 3</div>



	<div id="footer" style="position:relative;">
		a footer here
	</div>
</body>
</html>

Open in new window

0
Comment
Question by:brettr
  • 2
4 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 36508009
<html>
	<head>
	</head>
	<body>
		<table height="100%" border="1" width="100%">
			<tr>
				<td align="center">
					<div>top div here</div>
				</td>
			</tr>
			<tr>
				<td align="center">
					<table border="1">
						<tr>
							<td><div style="BORDER-RIGHT:black 1px solid;PADDING-RIGHT:10px;BORDER-TOP:black 1px solid;PADDING-LEFT:10px;FLOAT:left;PADDING-BOTTOM:10px;MARGIN:10px;BORDER-LEFT:black 1px solid;WIDTH:200px;PADDING-TOP:10px;BORDER-BOTTOM:black 1px solid;HEIGHT:200px;TEXT-ALIGN:center">box 
									1</div>
							</td>
							<td><div style="BORDER-RIGHT:black 1px solid;PADDING-RIGHT:10px;BORDER-TOP:black 1px solid;PADDING-LEFT:10px;FLOAT:left;PADDING-BOTTOM:10px;MARGIN:10px;BORDER-LEFT:black 1px solid;WIDTH:200px;PADDING-TOP:10px;BORDER-BOTTOM:black 1px solid;HEIGHT:200px;TEXT-ALIGN:center">box 
									2</div>
							</td>
							<td><div style="BORDER-RIGHT:black 1px solid;PADDING-RIGHT:10px;BORDER-TOP:black 1px solid;PADDING-LEFT:10px;FLOAT:left;PADDING-BOTTOM:10px;MARGIN:10px;BORDER-LEFT:black 1px solid;WIDTH:200px;PADDING-TOP:10px;BORDER-BOTTOM:black 1px solid;HEIGHT:200px;TEXT-ALIGN:center">box 
									3</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<div id="footer" style="POSITION:relative">
						a footer here
					</div>
				</td>
			</tr>
		</table>
	</body>
</html>

Open in new window

0
 

Author Comment

by:brettr
ID: 36508093
Thanks but I'm not interested in tables.
0
 

Author Comment

by:brettr
ID: 36508103
I think the code below might be all I need for the footer part at least.
<div id="footer" style="clear:both;">

Open in new window

0
 
LVL 16

Accepted Solution

by:
HagayMandel earned 500 total points
ID: 36509120
<div id="footer" style="clear:both; width:90%; margin-left:auto; margin-right:auto;">

Open in new window

Change the width to fit your need (in px or %)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question