日期:2014-05-17  浏览次数:20683 次

这个强制居中的广告怎么写CCS?
现在这个广告在编辑器里看居中是正常的,但放到网页里就跑到左面去了,如果刷新一下页面又正常居中了。这得怎么弄?

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-699713860265424";
/* 468x60, 创建于 09-10-31 */
google_ad_slot = "2966590769";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
</table>

------解决方案--------------------
第一句改成:
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="margin:0 auto">

可以的话不要忘了结帖给分哦。
------解决方案--------------------
楼上正解 margin:0 auto;
------解决方案--------------------
要不再试试这样:
table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-699713860265424";
/* 468x60, 创建于 09-10-31 */
google_ad_slot = "2966590769";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
</table>
------解决方案--------------------
<p align="center">用得不对,胡乱加。

<td align="center">

------解决方案--------------------
你百度的不是用的很正常吗
<td width="386" align="center" height="330"> 
在td里 align="center" 就好

你下面GOOGLE的,却用了个没闭合的<p align="center">
------解决方案--------------------
楼主给的代码我在ie6、firefox、谷歌下测试,好像没问题啊,即使把浏览器窗口变小也没问题。