【问题标题】:How to insert Google Ads in left and right sidebar?如何在左右侧边栏中插入 Google Ads?
【发布时间】:2017-11-03 21:05:34
【问题描述】:

我想在我的site 上在左右侧边栏插入 Google Ads,但我不知道如何创建侧边栏。

这是我目前拥有的 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]");
}
 ?>

那么有人可以分享一些技巧,如何在需要创建如图所示的位置创建侧边栏吗?我试着插入这个:

<div class="google">
// Google Code here
</div>

还有这个 CSS:

.google {
margin-left:-250px;
}

但看起来我的主页内容被破坏了。

【问题讨论】:

标签: php html css sidebar


【解决方案1】:
    .google {
       left: 250px;
     }

还创建一个容器并以 px 为单位指定其宽度,而不是 %。 希望这能解决您的问题。

【讨论】:

  • 当我添加它时,整个 body 类都被向下移动了。如何解决这个问题?我在下面插入了这段代码:&lt;/tr&gt; &lt;/table&gt;&lt;/td&gt; &lt;/tr&gt;
  • 将整个宽度设置为 % 更改为 px。我的意思是width:%;width:px;
猜你喜欢
  • 2022-08-09
  • 2018-04-19
  • 2014-10-15
  • 2012-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多