Welcome to WebmasterWorld Guest from 54.163.84.199

Forum Moderators: incrediBILL & martinibuster

Wrapping Text Around Adsense

How to position ads within text

   
11:43 pm on Apr 15, 2005 (gmt 0)

10+ Year Member



Does anyone have any pointers for code that will allow text within an article to flow around the Vertical Banner (120 x 240) or the Button (125x125)to the left or the right?

Thanks!

thvi

11:54 pm on Apr 15, 2005 (gmt 0)

10+ Year Member



We place our AdSense code in a table.
12:02 am on Apr 16, 2005 (gmt 0)



i usually wrap the ad code in a div and float it right or left.

example:

<div style="float:left">
google adsense code
<div>

12:08 am on Apr 16, 2005 (gmt 0)

10+ Year Member



Thanks for your replies! adsensenoob, could you please give a further example, using some text? I'm a SUPER html noob.

Many thanks,

thvi

1:18 am on Apr 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thvi, do you use cascading style sheets (css) for your site?
2:32 am on Apr 16, 2005 (gmt 0)

WebmasterWorld Senior Member annej is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If you want a little margin around the ad do this. You can change the px to more or less.

<div style="float: left; margin: 5px 5px 5px 5px;">
copy adsense code here
</div>

This is an inline form of CSS.

3:16 am on Apr 16, 2005 (gmt 0)

10+ Year Member



Thanks for your replies. hyperkik, we do use css, Thanks annej for your code! We will give it a try. If anyone could take a look below at this example and show us where to put the code you suggest, that would be great!

Many thanks,

thvi
<snip>
</body>

</html>

[edited by: Brett_Tabke at 11:43 pm (utc) on May 3, 2005]
[edit reason] Thanks - we do english here and english alone. [/edit]

4:03 am on Apr 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since you use CSS, I would suggest defining an ID for each AdSense block, rather than defining the float and margin in your html, such that you can more easily make sitewide changes in the layout. The best location for your ads will vary depending upon your content and the rest of your layout, so I suggest experimenting a bit. (For example, some have suggested that a large ad block at the top of the text gives the best returns; others find that wrapping the text around an ad block after the first or second paragraph is best.)
5:28 am on Apr 16, 2005 (gmt 0)

WebmasterWorld Senior Member annej is a WebmasterWorld Top Contributor of All Time 10+ Year Member



thvi,
Put it just before the <P> of the paragraph that is about where you want to ad to be. The top of the ad will be even with the beginning of that paragraph and the text will wrap around it. If you said "right" it will go to the right and if "left" it will go to the left.
2:55 pm on Apr 16, 2005 (gmt 0)

10+ Year Member



This is how you would do it using a table:

<html>
<head>
<title>At vero eos et accusamus</title>
</head>

<body>

<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. emporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. </p>

<p>
<table align="right" border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<!-- Insert Google Ad Code Here -->
</td>
</tr>
</table></p>

<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non ecusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. </p>

</body>
</html>

4:29 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



I am using the above table but the text wraps around the adsense too closely (they kind of run together).

How would I put in a blank space between where the adsense meets the text using the table example above?
4:39 pm on Apr 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Increase the number for "cellpadding" to the desired number of pixels.
4:52 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



hyperkik

Thank you very much for replying. That was exactly what I needed!

1:18 pm on May 6, 2005 (gmt 0)

10+ Year Member



Is there any problem with browser compatibility when using the div method to wrap the text around the ads? Just curious. I read somewhere that Netscape still have problems with the div tag.

Thanks.

1:44 pm on May 6, 2005 (gmt 0)

10+ Year Member



It depends on which version of the browser you're talking about. However, at this point all the recent versions of major browsers support CSS well enough that I think it makes sense to use CSS. You can even make an informed decision about using CSS or not by capturing the User-Agent HTTP header that most of the browser will send you and seeing what versions of various browsers people are generally using to access your site. Do a Google search on "browser masquerading" for more info about user agent stuff.\

Eric

 

Featured Threads

Hot Threads This Week

Hot Threads This Month