Php 如何在左右侧边栏中插入谷歌广告?

Php 如何在左右侧边栏中插入谷歌广告?,php,html,css,sidebar,Php,Html,Css,Sidebar,我想在我的电脑上在左右侧边栏插入谷歌广告,但我不知道如何创建侧边栏 这是我当前拥有的my header.php代码中的代码: <?php include "config.php"; ?> <html> <head><meta name="adtictac-site-verification" content="1qvt6zbzk026xfomo6gxbxxhjk9t96obv58gpcv3n9ver69s0"><meta name="c

我想在我的电脑上在左右侧边栏插入谷歌广告,但我不知道如何创建侧边栏

这是我当前拥有的my header.php代码中的代码:

<?php
include "config.php";
?>
<html>
<head><meta name="adtictac-site-verification" 
content="1qvt6zbzk026xfomo6gxbxxhjk9t96obv58gpcv3n9ver69s0"><meta 
name="clckd" content="273a893ce34e0acd4ba2655313b5f902" />
 <title><?php echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#2C60A9" leftmargin="1" topmargin="0" marginwidth="0" 
marginheight="0">
<table width="777" border="2" bgcolor="#ffffff" align="center" 
cellpadding="0" cellspacing="0" class="border">
<tr>
<td><img src="images/header.jpg" width="777" height="210" alt=""></td>
</tr>
<tr>
<td background="images/bg.jpg"><table width="100%" border="0" 
cellspacing="0" cellpadding="0">
  <tr>
    <td width="30%"><img src="images/links.jpg" width="231" height="17" 
alt=""></td>
    <td width="7%"><A href="index.php"><img src="images/home.jpg" width="54" 
height="17" alt="" border="0"></a></td>
    <td width="11%"><A href="join.php"><img src="images/register.jpg" 
width="83" height="17" alt="" border="0"></a></td>
    <td width="7%"><A href="faq.php"><img src="images/faq.jpg" width="54" 
height="17" alt="" border="0"></a></td>
    <td width="12%"><A href="contactus.php"><img src="images/contact-us.jpg" 
width="98" height="17" alt="" border="0"></a></td>
    <td width="12%"><A href="advertise.php"><img src="images/advertise.jpg" 
width="92" height="17" alt="" border="0"></a></td>
    <td width="21%"><A href="login.php"><img src="images/login.jpg" 
width="49" height="17" alt="" border="0"></a></td>

  </tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
    <td class="bodytext">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="7%">&nbsp;</td>
    <td width="91%" class="bodytext"><p align="justify">

<?php
include "config.php";
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and 
approved=1 and adtype=1 order by rand() limit 0,1");
while($arr=mysql_fetch_array($rs)) {
echo "<br><center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img 
src=$arr[1] width=468 height=60 border=0></a><br></center><br>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where 
ID=$arr[0]");
}
 ?>
但看起来我的主页上的内容坏了

    .google {
       left: 250px;
     }
同时创建一个容器,并以px为单位指定宽度,而不是%。
我希望这能解决您的问题。

试着阅读一下如何在css中创建网格,这里有一个例子,当我添加这个时,整个body类被下移了。。如何解决这个问题?我在下面插入了代码:
将整个宽度设置更改为%px。我的意思是
宽度:%
宽度:px
.google {
margin-left:-250px;
}
    .google {
       left: 250px;
     }