side by side banner code
i have a side by side banner code ,the work fine on Firefox.IE,opera,. but not work on google chrome how do i s开发者_C百科olved this problem ?
<table border="0" width="100%">
<tr>
<td>my Banner</td>
<td> </td>
</tr>
</table>
Take them out of the table, and use CSS to float:left;
each banner, inside a container div. As long as their width allows it, they should line up side by side, in Chrome as well.
using your example:
<div id='container'>
<img src='banner1.png' style='float:left;' />
<img src='banner2.png' style='float:left;' /></div>
The best way would be to use a .css stylesheet and a banner class to separate your html from your css, but this is just an example to get you started :)
EDIT: I don't use inline javascript really, ever..so this is just a guess if you can do this or not, but it's worth a try.
<div id='container'><span style='float:left;'>
<script language='JavaScript' type='text/javascript'
src='zarclick.ir/banner.php? uname=pitgo&type=2&rows=1' >
</script></span><span style='float:left;'><script language='JavaScript'
type='text/javascript' src='zarclick.ir/banner.php? uname=pitgo&type=2&rows=1'
></script></span></div>
Might work, I'd try it if I needed to do it.
You should read this tutorial on how to create tableless layouts as this is the standard used for web 2.0 pages. You should always seperate the content from the layout in your web page, which means that your HTML file/s should only display the content, while the CSS file/s will contain the layout, and the JS file/s will contain the HTML manipulation scripts.
http://webdesign.about.com/od/css/a/aa102102a.htm
精彩评论