Tampilkan postingan dengan label zzz - check update for new AdSense interface. Tampilkan semua postingan
Tampilkan postingan dengan label zzz - check update for new AdSense interface. Tampilkan semua postingan

Kamis, 04 Februari 2010

AdSense Layouts:  using tables, not too many Divs

AdSense Layouts: using tables, not too many Divs

This article has details about laying out AdSense ads side-by-side with the text in your Blogger postings.

Previously I've explained how to put an AdSense ad-unit "in-line"  in your blog post.   Using this approach,  the advertisement is put in a block of its own, and your content starts again underneath it.

However you can use DIV statements to allow your text to flow around the ad.  I've described how do use this approach for putting text and pictures side by side in your blog, and it could easily be used for ad-unit code instead.

That said, in Jan 2010, AdSense's blog gave advice to:
"avoid embedding the ad code in excessive div tags or nested frames".   
They didn't say what counts as excessive - but just in case, it may be a good idea to use a separate div for the ad rather than embedding <div> statements.

If you do want to put an ad and your content side-by-side, it may be better to use a table to lay them out.  To achieve this, you need to edit the HTML behind the post.  To get to this click on the HTML button in the top right of the editor (post Sept-2011 Blogger) or the Edit HTML tab in the top right of the editor (pre-Sept 2011 Blogger).

Use a piece of HTML code like this:
<br />
<table border="0" style="width: 100%;">
<tbody>
<tr>
<td>PUT THE POST TEXT IN HERE </td>
<td>PUT THE AD-TEXT IN HERE </td>
</tr>
</tbody></table>


Related Posts:



AdSense Troublehooting hints-and-tips overview

Puutting text and pictures side by side in your blog

How to put an AdSense ad-unit "in-line"  in your blog post

Using a table to display data in your blog


AdSense Troubleshooting:  Extra line breaks

AdSense Troubleshooting: Extra line breaks

This article is about fixing problems with AdSense advertisements that are caused by having extra line-breaks in the ad-code.



Putting AdSense ads into your posts - what can go wrong

Battle of the Canal du Nord - Horse drawn artillery wagonPreviously I've explained how to set up AdSense for your blog, and how to put AdSense advertisements
right inside a post rather than in the header, footer or sidebar.

However AdSense ad code won't work if it has any extra line breaks added to it.  This is why, to put it  you need to paste the code into the editor in Edit HTML mode, not Compose mode.   And to be certain, I also recommend that you make sure the "use <br /> tags" option (previously called "Ignore new lines") is chosen as well.

If you don't do this, ie if you put the code into the Post Editor while you are in Compose mode, Blogger seems to insert extra <br /> tags (ie new lines) in places.  And this causes the ad to not be displayed.


Fixing the problem


If you encounter this problem while putting ad-code into a post in this way, it's best to go in to Edit HTML mode and:
  • remove the whole piece of Ad code
  • in a separate window, log into AdSense (www.google.com/adsense), choose the Ad you want from  from Adsense Setup / Manage Ads
  • copy the ad code
  • swtich back to your blogger window and paste the ad-unit in again
Removing the line-break characters by hand is tedious to do, and I've found it's very hard to get right.




Related Articles:



AdSense Troublehooting hints-and-tips

Putting AdSense ads inside blog posts

The Post Editor's  <br /> tags vs new-line option.