Why don't we just use tables anymore?

73 Views Asked by At

http://amtportal.org/Layouts/navbar2.php

The footer doesn't show up in Firefox and the Navigation bar on top doesn't show in IE. Why?

1

There are 1 best solutions below

0
On

You have no <!DOCTYPE html> (or other variant, depending on what doctype you want) as the first tag in the document, which forces IE into quirks mode. I can't speak for Firefox because I don't have it installed, but this might cause similar issues.

Adding a doctype is just the first step so all browsers will attempt to render the page to the same standard. Without it, you will never get a non-trivial page to look the same in all browsers.

For a quick fix,

.footer{
    height:70px;
    background:#d3d3d3;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.wrapper{
    position: relative;
    width:770px;
    margin: 0px auto;
    padding-left: 10px;
   min-height: 100%;
}

margin-bottom: -70px; was forcing the page up, making the navigation bar disappear off the top of the screen. Making the footer abosolutely positioned on the bottom is a bit of a hack, but it works. But there are many templates and examples out there for content with footers on the bottom; having a doctype will make them actually work.