473,397 Members | 2,084 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,397 software developers and data experts.

footer and wrapper alignment

2
Hi,

First post, but lurked for a while!

Probably something really simple, but my footer doesn't seem to want to align with its containing div. Its slightly off to the right.

I don;t really understand why - the background image is exactly 850px, as is the div.

Just to let you know, i've put borders around the other elements, just to make the design easier, but not the footer.

Expand|Select|Wrap|Line Numbers
  1. @charset "utf-8";
  2. /* CSS Document */
  3.  
  4. #wrapper {
  5.   width:850px;
  6.   height:650px;
  7.   margin:0 auto; /* this centers the page */
  8.   padding:0;
  9.   border-style:solid;
  10.   border-width:1px;
  11.   border-bottom-style:none;
  12.   border-top-style:none;
  13. }
  14.  
  15. #header {
  16.     background:url(navbar.png);
  17.     background-position: left bottom;
  18.     background-repeat:no-repeat;
  19.     height:200px;
  20.     border-style:solid;
  21.     border-width:1px;
  22.  
  23. }
  24.  
  25. #logo {
  26.     background:url(logo.png);
  27.     width:191px;
  28.     height:82px;
  29.     margin:55px 34px;
  30.     padding:0px;
  31.     border-style:solid;
  32.     border-width:1px;
  33. }
  34.  
  35. #contentnav {
  36.     width:150px;
  37.     height:400px;
  38.     float:left;
  39.     margin:16px;
  40.     border-style:solid;
  41.     border-width:1px;
  42. }
  43.  
  44. #contentmain { 
  45.     background:url(content.png);
  46.     background-repeat:no-repeat;
  47.     width:600px;
  48.     height:400px;
  49.     float:right;
  50.     margin:16px;
  51.     border-style:solid;
  52.     border-width:1px;
  53. }
  54.  
  55. #footer {
  56.     clear:both;
  57.     background:url(footer.png);
  58.     background-repeat:no-repeat;
  59.     background-position:left bottom;
  60.     width:850px;
  61.     height:200px;
  62.     margin:0px;
  63.     border-style:solid;
  64.     border-width:1px;
  65. }
  66.  
  67.  
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.  
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.  
  7. <link href="hisstylesheet.css" rel="stylesheet" type="text/css" />
  8.  
  9. <title>Untitled Document</title>
  10.  
  11. </head>
  12.  
  13. <body>
  14.  
  15.     <div id="wrapper">
  16.         <div id="header">
  17.             <div id="logo">
  18.             </div><!-- end #logo -->
  19.  
  20.         </div><!-- end #header -->
  21.  
  22.         <div id="contentnav">
  23.  
  24.         </div><!-- end #contentnav -->
  25.  
  26.         <div id="contentmain">
  27.  
  28.         </div><!-- end #contentmain -->
  29.  
  30.         <div id="footer">
  31.  
  32.         </div><!-- end #footer -->
  33.  
  34.     </div><!-- end #wrapper -->
  35. </body>
  36.  
  37.  
  38.  
  39. </html>
  40.  
Here is the image.



Its really getting on my nerves!!!!!

Thanks,

Jeff
Jul 7 '10 #1
3 2478
TheServant
1,168 Expert 1GB
Remove your #wrapper border. Or play around by changing your #wrapper to 852px, or your footer/header to 848px. You need to take borders into account with widths.

And the footer does have a border.
Jul 7 '10 #2
j3ff3
2
so it does! thanks for the quick reply.

let me post a picture with the elements outlined. it makes the problem a bit clearer



see?

the #wrapper overlaps with the #footer.....

I'll try taking all the borders off like you suggested though.

cheers
Jul 7 '10 #3
TheServant
1,168 Expert 1GB
Try give the #wrapper a overflow: hidden; property.

Oh, and also, you have set your #wrapper height to 650px which does not add up with the 200px header, 400px content, and 200px footer. I suggest you take out all the heights to make it more fluid.
Jul 8 '10 #4

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

Similar topics

1
by: J.Storta | last post by:
On my site, I have created a footer that is simply a shaded box with a &nbsp; character. Using Server Side Includes, I use this footer on every page. On some pages it loads fine, on other pages...
1
by: Cruzweb | last post by:
http://storm-enterprises.net/cgi/contact.php is the design Works fine in ie, but in firefox the content <div> expands behind the footer <div> and through the wrapper <div> background. Any help is...
0
by: John Crowley | last post by:
I keep running into this over and over again... I want a block server control that renders a header and footer, and child controls in between. But I don't want a templated control, for the...
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...
1
by: Mercy | last post by:
Hey All, This is probably a easy question, but I'm really stuck. I have a command console program written in C++, that I want to convert it to C# to make it into a windows app. The problem is...
7
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
5
by: markthedoc | last post by:
Hi I've got a problem with excess space under my footer. I want the page to finish at the bottom of my footer, but the background image of the body tag carries on until it reaches the bottom of...
14
by: issentia | last post by:
I'm working on this site: http://www.essenceofsoy.com/redesign/index2.html and I'm having a few problems with getting the layout exactly right. 1) When the menu items are rolled over, they...
3
by: Noorain | last post by:
I designed a site. i want to header,footer,left & right column fixed but body information only scrolling. this site screen to be 800/600 px. i designed this way but when i used position fixed all...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.