Forum Moderators: not2easy

Message Too Old, No Replies

Scrolling box in Safari

Scrolling box positions wrongly in Safari

         

tcbigcat

8:32 am on Jun 6, 2009 (gmt 0)

10+ Year Member



Hi, I have just finished my first 'proper' website and, after some much-needed help from this forum, it now displays beautifully in Firefox, Opera, and IE. However, I happened to check one of the other pages, which contains a scrolling box which contains a table. It works fine in everything but Safari (and Navigator), where the entire scrolling box and contents shoots off to the far right of the screen. Any ideas, anyone?

Doctype is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> and both code and CSS validate fine.

The framework of the code and the relevant CSS are below. Any help would be much appreciated.

<body>

<div id='wrap'>

<div id="main">

<div id="nav">

<ul>
<li</li>
</ul>


</div><!--end div nav-->

<br />

<div style="overflow:auto; height:268px; width:435px">
<table>

<tr>
<td class="name"><br /><span class="company"> </span></td>
<td class="bodytext" rowspan="2"> </td>

</tr>

<tr>
<td colspan="2">
<p>&nbsp;</p></td>
</tr>

<tr>
<td class="name"> <br /><span class="company"> </span></td>
<td class="bodytext" rowspan="2"> </td>

</tr>

<tr>
<td colspan="2">
<p>&nbsp;</p></td>
</tr>


</table>

</div><!--end div overflow-->

</div><!-- end div main -->

<div id="sidebar">

(There are just some images in here)

</div><!-- end div sidebar -->

<br class="clear" />

</div> <!-- end div wrap -->

</body>

#wrap {
width:745px;
padding-top:5px;
padding-bottom:5px;
background-color:#fff;
margin-left:auto;
margin-right:auto;
}

#main {
float:left;
width:430px;
text-align: left;
line-height:1.2;
padding:20px;
background-color: #FFF;
margin-top:5px;
margin-right:5px;
list-style:none;
}

#sidebar {
float:right;
width:260px;
padding:5px;
margin-top:20px;
list-style:none;
background: #fff;
border: none;
}

.clear {
clear:both;
}

Thank you!
Tanya

swa66

9:05 am on Jun 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't you have overlapping cells in your html ?

There's no prediction how a browser will render that, in fact the CSS standard gives the freedom to do as they see fit.

[w3.org...] :
See rule #5 and the example below (which is almost what you have above.


<table> 
<tr><td>1 </td><td rowspan="2">2 </td><td>3 </td><td>4 </td></tr>
<tr><td colspan="2">5 </td></tr>
</table>

User agents are free to visually overlap the cells, [...], or to shift the cell to avoid the visual overlap, [...].

tcbigcat

10:00 pm on Jun 6, 2009 (gmt 0)

10+ Year Member



Ah, it took a few minutes and I had to draw a picture, but yes, you're right. Thanks once again for pointing me in the right direction.