Forum Moderators: open

Message Too Old, No Replies

Differences in content position with tables in FF3 and IE7

         

yannus1

2:16 pm on Apr 10, 2009 (gmt 0)

10+ Year Member


Hello,

I have some problem getting the same result in ff3 and ie7
here is the structure of the page. I removed the content which is some texts and flash content.in FF3 the content is a little bit lower. In IE7 it is as in the Dreamweaver preview. THX for your help

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DAO & Co</title>

<style type="text/css">
<!--
body { background-color: #FFF;}
a { outline: none;
color:#000}
:focus { -moz-outline-style: none;}
p{
font-family: Verdana;
font-size:36px;
font-smooth:always;
color:#383838;
line-height:23px;
}
-->
</style>

</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="position:absolute; top:50%; margin-top:-260px;">
<tr><td align="center" valign="top">
<table width="960" border="0" cellspacing="0" cellpadding="0" background="pictures/bg-text.jpg">
<tr>
<td width="320" height="520" align="left" valign="top"><table width="320" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110" align="center" valign="middle">&nbsp;</td>
<td width="44" align="center" valign="top">&nbsp;</td>
<td width="44" align="center" valign="top">&nbsp;</td>
<td width="44" align="center" valign="top">&nbsp;</td>
<td align="center" valign="middle">&nbsp;</td>
</tr>
</table></td>
<td width="640" valign="top" align="left"><table width="640" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="210" height="15"></td>
<td width="320">&nbsp;</td>
<td width="110">&nbsp;</td>
</tr>
<tr>
<td height="78">&nbsp;</td>
<td>&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34" height="30"></td>
<td align="left" valign="top" colspan="2">&nbsp;</td>
</tr>
<tr>
<td height="290" align="right" valign="middle">&nbsp;</td>
<td width="190" valign="top"><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>A</p></td>
<td align="left" valign="top" width="390"><p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">A</p></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

CSS_Kidd

2:38 pm on Apr 10, 2009 (gmt 0)

10+ Year Member



It's just the way that each browser renders certain elements. By default there are margins and padding set to some elements. Like the body tag. notice how by default it always has a margin of about 10 to 15 px from the edge of the window. This will appear more or less in different browsers. <p> is the same. Just style these elements with a padding and margin value of 0. and start from there. Or what I do is just kill them all at once by creating this rule:

* {
margin:0;
padding:0
}

But then you have to go back and adjust everything for the spacing you want.

yannus1

8:19 pm on Apr 10, 2009 (gmt 0)

10+ Year Member



Thanks a lot, I'll test it on Tuesday. I didn't know that one could turn them all off. It's really cool.

g1smd

8:40 pm on Apr 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why are you mixing HTML attributes and CSS styles for sizing?

Note that all CSS sizes need the units to be specified: px, em, pt, %, etc.

swa66

8:44 pm on Apr 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



:focus { -moz-outline-style: none;}

I think this is against some accessibility guidelines (if you navigate with a keyboard instead of a mouse it's handy to know what you're going to "click" on).

yannus1

6:47 am on Apr 14, 2009 (gmt 0)

10+ Year Member



Thanks everybody,

-CSS_Kidd
so I removed the cellpading and cellspacing in the tables and added your code to the css but it didn't seem to work, the margins appeared then.

-g1smd
could you please give me an example of how to do it in CSS

-swa66
I used this code to remove an ugly outline around my swf content. In this website design is more important than accessibility.

Thanks again to everyone

yannus1

10:50 am on Apr 16, 2009 (gmt 0)

10+ Year Member



I'm still experiencing the same problem. Can anyone help me ?

tedster

9:10 pm on Apr 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With cross-browser display problems, always start by validating your source code:

W3C Validator - HTML [validator.w3.org]
W3C Validator - CSS [jigsaw.w3.org]