views:

3793

answers:

5

Hi,

Due to current limitations on getting DIV tags to work well across browser platforms for the particular liquid layout I desire, I have opted to use a combination of Tables and DIVs for layout. That being said, a couple of issues remain.

The FIRST issue is that in Firefox, my table row height for my footer is being rendered differently than it is being rendered in IE when using a table with a height of 100%. What happens is that in Firefox the footer row for the table has a height that is greater than the height specified for the table row. This, in turn, throws off my footer layout.

Here is the code for the page:


<html>

<head>

<meta NAME="DESCRIPTION" CONTENT="Cold Fusion Applications and Development">

<meta NAME="keywords" CONTENT="cold fusion, coldfusion, sql server, graphic design, houston, texas, tx, web developer, web development, e-commerce, survey, surveys, web applications, php, mysql, access, foxpro, sql, perl, shopping cart, web programming, macromedia, webmaster, html, cfml, xml, 77057, cfware, cfware.com, www.cfware.com, hosting, dhtml, dynamic html, web programmer, graphic designer, website, resume">

<link href="style.css" rel="stylesheet" type="text/css">

</head>
<!-- BODY -->
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0">
<!--TABLE I -->
<table class="fullheight" width="100%" height="100%" min-height="100%" border="1" align="center" cellpadding="0" cellspacing="0">
   <tr><td height="116" align="center" valign="top">
       <!-- HEADER -->
       <div class="header">
       <div class="lfc">Cornerstone</div>
       <div class="rfl"><img src="c4sqlogo.gif" width="295" height="68"></div>
       <div class="lf4">Foursquare</div>   
       </div>
       <div class="spacer"></div>
       <!-- HEADER END -->
       </td>
   </tr>
   <tr><td align="center" valign="center" bgcolor="#FFFFFF">  
             <!-- CONTENT -->
             <div class="content">


<table class="fullheight" width="100%" height="100%">
<tr>
<td></td>
<td></td>
<td></td>
</tr><tr>
<td></td>
<td align="center" valign="middle">
<h1 class="font-black">Cornerstone Foursquare Church</h1>
<br>
<h2>7791 Hillbarn Dr. Houston, TX 77040</h2>
<br>
<h2>(713) 856 - 7773</h2>
<br>
<br>
<h3>Service Times:<br>Sunday Morning Worship 10:30AM<br>Sunday Evening Bible Study 6:00PM
<br>Wednesday Evening Bible Study and Prayer 7:00PM</h3>
</td>
<td></td>
<tr>
<td></td>
<td></td>
<td></td>
</tr><tr>
</table>


             </div>
             <!-- CONTENT END -->
       </td>
   </tr>
   <tfoot height="28"><td height="28" align="center" valign="middle" bgcolor="#FFFFFF">
          <!-- FOOTER --> 
          <div class="clearspacer"><img src="1.gif" height="10" width="1"></div>
          <div class="footer"><div class="footertext"><a href="http://www.c4sq.org"&gt; w w w . c 4 s q . o r g </a></div></div>
          <!-- FOOTER END -->
       </td>
   </tr>
</table>
<!-- TABLE I END -->
</body>
</html>


And here is the code for the sytle sheet:

html, body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
        color: :#a02f1d;
        height: 100%;
        width: 100%;
}

a {
color: #ffffff;
text-decoration: none;
font-size: 12;
font-weight: 500;
}

.header {
color: #ff0000; 
margin: 0 auto;
width: 760px;
height: 116px;
background-image: url(stripe.gif);
background-repeat: repeat-x;
}

.fullheight {
height:100%;}

.lf4 {
float: left;
margin-top: 0px;
clear: left;
width: 240px;
margin-left: 190px;
color: #a02f1d;
font-size: 26px;
font-weight: semi-bold;
font-style: italic;
}

.lfc {
float: left;
margin-top: 8px;
margin-left: 20px;
color: #a02f1d;
font-size: 48px;
font-weight: semi-bold;
font-style: italic;
}

.rfl {
float: right;
margin-top: 24px;
margin-right: 20px;
clear: right;
}

.content {
margin: 0 auto;
width: 760px;
overflow: hidden;
color: :#a02f1d;
}

.spacer {
background-color:#a02f1d;
margin: 0 auto;
width: 760px;
height: 4px;
overflow: hidden;
}

.clearspacer {
background-color:#000000;
}

.footer {
color: #ffffff; 
background-color:#a02f1d;
margin: 0 auto;
width: 760px;
height: 30px;
clear: both;
}

.footertext {
color:#ffffff;
margin-top: 6px;
font-size: 12px;
}


The SECOND issue has to do with modifying the existing layout so that there is a centered vertical area of 760px in width that displays in a shade of color different from the surrounding viewport. The primary difficulty is that in order to get my footer to stick to the bottom in both browsers and resize with the viewport, I had to re-adopt a table layout. The current strategy, however, is to use as few nests as possible in order to benefit from the speed and clarity from using DIVs. I would opt to use a DIV layout to the exclusion of a TABLE layout if it were not for the apparently, currently insoluble problem of getting a working sticky-footer to work with a DIV liquid layout.

Thanks very much in advance for all advice and inspiration!

MP

+2  A: 

I know this is quite unrelated, but I recommend that you use the w3c validator to validate your HTML once in a while.

K4emic
A: 

A couple suggestions:

Add a doctype - if use use the right one you can get IE to standards mode rather than quirks mode http://www.quirksmode.org/css/quirksmode.html, so behaviour will be more consistent between IE and other browsers.

As suggested by K4emic - validate your markup.

Add a css reset to zero default margins and paddings, a good starting point here http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/.

You will find that these things will make chasing down layout bugs a lot easier. Otherwise, you just won't know where to start, is it your css, your html, the default browser stylings, the rendering mode of IE......?

seanb
A: 

As the other responders pointed out you first have to make sure that your document is well formed. That is, it must conform to a DTD. I will point out one issue that is easy to spot:

<tfoot height="28"><td height="28" align="center" valign="middle" bgcolor="#FFFFFF">
      <!-- FOOTER --> 
      <div class="clearspacer"><img src="1.gif" height="10" width="1"></div>
      <div class="footer"><div class="footertext"><a href="http://www.c4sq.org"&gt; w w w . c 4 s q . o r g </a></div></div>
      <!-- FOOTER END -->
   </td>
</tr>
</table>

In this snippet you can see that your

<tfoot>

element is unclosed. It should contain

<tr>

but that is missing.

These small errors are probably causing the inconsistent behavior that you are witnessing. After they have been corrected if you are still getting the behavior then you can look at the browser differences. Some HTML editor like Frontpage and Dreamweaver can be set to out put code that conforms to a DTD and highlight areas that do not conform. I would recommend using one.

Vincent Ramdhanie
A: 

Thanks. I'll clean it up and re-post =)

Mark P
A: 

Thanks - after validating the html, it appears that the problem has to do with the alignment of the text more than with the structure of the table or the table's height.

1) the text does not appear vertically centered in the footer in Firefox; but it appears vertically centered in the footer in IE.

2) the text in the body of the document varies in size and boldness between IE and Firefox - any suggestions here?

Thanks very much in advance and here is the new HTML code: (ps - how do I get the code to show up as code here?)


--> --> --> -->

Cornerstone Foursquare, Houston

Cornerstone Foursquare Cornerstone Foursquare Church

7791 Hillbarn Dr. Houston, TX 77040


(713) 856 - 7773



Service Times:
Sunday Morning Worship 10:30AM
Sunday Evening Bible Study 6:00PM
Wednesday Evening Bible Study and Prayer 7:00PM

         </div>
         <!-- CONTENT END -->
   </td>

w w w . c 4 s q . o r g

Mark P