473,388 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to set footer always at he bottom

I have a page which should have a "sidebar" to the right, and a "main" block of content to the left. I want to represent each block as a <div>, and a footer always at the bottom of page no matter what the height of divs is.so any help?!
Mar 31 '11 #1
5 3363
JnrJnr
88
Hi anthonymouallem, it depends on how big the body of your page is. Put the <div id = "footer"> at the bottom of all your <div>'s.

example:
if this is your body with its <div>'s...

Expand|Select|Wrap|Line Numbers
  1. <body>
  2.  
  3. <div id = "header">
  4. <div/>
  5.  
  6. <div id = "body">
  7. <div/>
  8.  
  9. <div id = "footer">
  10. <div/>
  11.  
  12. <body/>
Your CSS could look like this:

#footer
{
background-color: #FFCC00;
height: 50px;
margin-top: 30px;
margin-left: auto;
margin-right: auto;
margin-bottom: 0px;
}

pls mark as answer if it is
Apr 3 '11 #2
sorry im new at this

should i add both the codes html and css ?
May 4 '11 #3
Ok i added this but it's still at the middle of my page . i dint want to add the <br> in the middel of my text
May 4 '11 #4
JnrJnr
88
Yes, you can either add the css code in a seperate style sheet file to allow easy style changes to all the pages or add css code to the same page as the html eg.
<head>
<style type="text/css">
.footer
{
background-color: #FFCC00;
height: 50px;
margin-top: 30px;
margin-left: auto;
margin-right: auto;
margin-bottom: 0px;
}
</style>
</head>
May 4 '11 #5
JnrJnr
88
Can you give me a markup of what youv'e done and tell me what you want to do.
May 4 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Robert Ashby | last post by:
I have a .jpg footer on my .aspx web page. When the datagrid loads it floats over the top of the web page footer. The footer does not move. I would like to footer to float on the web page and...
3
by: Guadala Harry | last post by:
I'm using HTML tables to define the layout of a non framed aspx page. How can I cause a page footer (html table, itself) to appear at the bottom of the page when the page content would not be...
2
by: Saket Mundra | last post by:
I have a webform in which i have used Image Control for displaying Header & footer. I have noticed that when i open the same webform in differnet IE windows having different settings for toolbars,...
4
by: sonya11 | last post by:
hi all, sorry I realize the topic is well known, anyway is there a way without using javascript to have a footer always under a 3 column layout with Absolute Positioning ? I don' t want to...
0
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
2
by: dubing | last post by:
Hi, I'm trying to create a style sheet for print. Part of the style sheet is shown below. The three columns are layed out fine. But the footer is messed up with the navigation menu at the...
1
by: lisa232 | last post by:
Hi All, I am trying to position the footer div in my page to stay at the bottom of the screen when the content does not reach or exceed the height of the browser window. I am able to position it...
2
by: heban | last post by:
Hi, I'm having trouble getting the footer to the bottom of the page with my CSS code. It works in IE, but not in Firefox. Here is my css: .pagecontainer{ position:relative; ...
0
by: sannymak | last post by:
Hello All, I have some problems making the columns 100% and forcing the footer at the bottom. Please refer to the code below and let me know a solution: HTML CODE: <!DOCTYPE html PUBLIC...
5
by: Dave Rado | last post by:
Hi When the height of the content of a webpage is less than the height of the viewport, I would like to force the footer to the bottom of the viewport; whereas when the height of the content of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.