Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
sticky footer no longer sticky after declaring doctype
Old 09-24-2010, 09:55 PM sticky footer no longer sticky after declaring doctype
Junior Talker

Posts: 1
Name: hassan
Trades: 0
My sticky footer now floats in the middle of the page after i declared a doc type. Any suggestions for a quick fix?

doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

HTML Code:
<body>
    <div id="wrap">

    <div id="header"></div>
    
    <div id="logoimg"></div>
    
    <div id="logotext"></div>

    <div id="searchbox">
      <img src="" align="absmiddle" vspace="2px"/>
      <label for="searchfield">search: area, position, area+position</label><br>
      <input type="text" name="searchfield" value="" 
         id="searchfield"/> <div id="geist"></div>
                            </div>             
   
   
    <div id="main"></div>
      </div> 
    
    <div id="footer"></div>
Code:
body {
    background-color: #99ccff;
    background-image: url(http://);
    background-repeat: repeat-x;
    overflow: auto;
    margin: 0;
    padding: 0;
    height: 100%;
}

#wrap{
    min-height: 100%;
    margin-top: -151px;
} 

#footer {
   margin: auto;
   width: 100%;
   height: 100px;   /* Height of the footer */
   background: #3e4041;
   border-top: 1px solid #e0e0e0;
   clear: both;
   margin-top: 50px;
}

/*Opera Fix*/
body:before {/* thanks to Maleika (Kohoutec)*/
    content:"";
    height:100%;
    float:left;
    width:0;
    margin-top:-32767px;/* thank you Erik J - negate effect of float*/
    margin-bottom: 51px;
}

h1, h2, p {
    padding:0 10px;
}

#outer:after {/* thank you Erik J - instead of using display table for ie8*/
    clear:both;
    display:block;
    height:1%;
    content:" ";
}
hassan_2010 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-25-2010, 07:58 AM Re: sticky footer no longer sticky after declaring doctype
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
have you tried a different doc type?
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-25-2010, 04:15 PM Re: sticky footer no longer sticky after declaring doctype
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
It's NOT the doctype.
I don't find any problem with it. You have nothing inside your layout, but if I give #main a height, just to mimic it having content, the footer stays at the bottom as it should.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-27-2010, 10:52 AM Re: sticky footer no longer sticky after declaring doctype
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
couldn't get that code working at all. I've used this one before, which works fine, give it a go:

http://ryanfait.com/sticky-footer/
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Reply     « Reply to sticky footer no longer sticky after declaring doctype
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.06247 seconds with 12 queries