天方随笔
为Google Adsense添加图片
business » » » » »

原来的Google Adsense都是文字,太枯燥、单一,而且由于我首页的Adsense放在右下脚,不太容易被关注到

记得以前浏览一个网站的时候,Adsense旁边有小图标相伴,比较醒目,于是自己也摸索着做了这样的样式

Google_Adsense_pic.gif

原理其实很简单,就是用到了基本的div+css

Google_Adsense_pic_div.gif

这是我本地测试用的代码:

 <div id=”fp_ads”>
   <div id=”ad_pic”>
    <li>
       <img src=”
http://localhost/wordpress/wp-content/themes/aquasoft/images/ad1.gif“  />
      </li>
       <li>
       <img src=”
http://localhost/wordpress/wp-content/themes/aquasoft/images/ad2.gif“  />
      </li>
       <li>
       <img src=”
http://localhost/wordpress/wp-content/themes/aquasoft/images/ad3.gif“  />
      </li>
       <li>
       <img src=”
http://localhost/wordpress/wp-content/themes/aquasoft/images/ad4.gif“  />
      </li>
       <li>
       <img src=”
http://localhost/wordpress/wp-content/themes/aquasoft/images/ad5.gif“  />
      </li>
   </div>
   <div id=”g_ads”>
   <!–adsense–>
   <center>
  <script type=”text/javascript”><!–
  google_ad_client = “pub-9679122645467323″;
  google_ad_width = 160;
  google_ad_height = 600;
  google_ad_format = “160×600_as”;
  google_ad_type = “text”;
  google_ad_channel =”1073247533″;
  google_color_border = “f4f4f4″;
  google_color_bg = “f4f4f4″;
  google_color_link = “124ADF”;
  google_color_text = “124ADF”;
  google_color_url = “2E8B57″;
  //–></script>
  <script type=”text/javascript”
    src=”
http://pagead2.googlesyndication.com/pagead/show_ads.js“>
  </script>
 </center>
   <!–adsense–>
   </div>
  </div>

相应的css:

#fp_ads {
height:570px;
}
#ad_pic {
position:relative;
top:-13px;
height:550px;
width:70px;
float:left;
}
#ad_pic li {
margin:60px 0 0 0px;
padding-left:10px;
color:#f4f4f4;
}
#g_ads {
float:left;
}

为这篇日志打一下分吧: 1 Stars2 Stars3 Stars4 Stars5 Stars

4 Votes | Average: 3 out of 54 Votes | Average: 3 out of 54 Votes | Average: 3 out of 54 Votes | Average: 3 out of 54 Votes | Average: 3 out of 5 (4 votes, average: 3 out of 5)



回复




  • Google
     
    Web blog.kenbeyond.com