January 24th, 2008 by Tom

You may see the technique that wrap text around image or adsense ads in many websites, you may want to use this technique in your website or blog but have no idea how to do it.

Actually, this is just a basic in Css about floating but many people don’t know how to do it, I always got questions about how to do this thing so I decided to write this tutorial.

The secret of this technique is a float tag , float: left; , if you want you div box align left, float: right; , if you want your div box align right. see a sample code below or download sample files here. Note : you can change attribute name (.ads_left, .ads_right) to your own.

Example

Css Style Code Wrap Text Around Image or Ads

Save this code in your Css style file.

The Css style code


.ads_left {
float: left;
padding: 5px;
margin: 0;
}

.ads_right {
float: right;
padding: 5px;
margin: 0;
}

How to use it.

Insert this code into you content where you want your image or adsense ad to be displayed (you can view an example in my sample file, download here)

<div class="ads_left"> Your image or ad </div>
<div class="ads_right"> Your image or ad </div>

Related Posts

12 Responses to “Css Style Code Wrap Text Around Image or Ads”

Leave a Reply