English 中文(简体)
Follow up to first question CSS, FOOTER is floating to the top
原标题:
  • 时间:2009-12-25 18:52:52
  •  标签:
  • css
  • footer

ok this header image is driving me crazy-- ive cleaned up the divs and edited the css - before i learn positioning etc, id love to see a quick fix that just puts that image down at the bottom of the page

sorry, the question was in the title-- im trying to get the footer not to float on top of the page but ive gotten some responses about absolute positioning so ill try and work on that myself, additional answers still appreciated, thanks

http://we-live.in/the_sierra

<div style="text-align:center;">

  <div id="footernav">
  <a href="index.php" class="footerlink">Home</a>
  <a href="about.php" class="footerlink">About Us</a>
  <a href="mailto:info@neighborrow.com"  class="footerlink end">Contact Us</a>

  </div>
最佳回答

The problem is that you are using absolutes. Absolutes do not affect the flow (in other words for the positioning of other elements it s as if they don t exist).

Do something like this (I ve put the css as text)

<div id="wrapper">
     <div id = "main">
          <div id="to">FLOAT:LEFT</div>
          <div id="from">FLOAT:RIGHT</div>
          <p class="extro">CLEAR:BOTH</p>
     </div>
<div id="footer"></div>
</div>
问题回答

Your main content div appears to be the div with the id "to_div". Your footer floats to the top because you ve used position:absolute on to_div which takes it out of the flow. Either absolutely position your div on the bottom or stop using absolutely positioning. I recommend the latter.

That happens because you have set up to absolute the position of each div (to_text, nav_deals, etc.) but the div that contains the footer is rendered as a normal div element (because its position is not absolute)!

I suggest to redo this simple layout without the absolute positioning! Or you can solve by setting to absolute even the position of the last div!





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签