I’m just posting this here because even after almost a decade of building websites I can NEVER remember the code to float an ad or image where I want it.  I always have to look it up – and I’m sure I’m not the only one.  Considering how often we ad advertisements/adsense/images to our blog posts, and websites it’s a little trick that you HAVE to know.

WordPress won’t automatically do this for you – so you have to go into the “html view” to add this.  If you are working with a website, it’s easier to add this to your css sheet as a rule for your ads or images but with wordress you always have to do it manually.

Let’s say that I have a long blog post and in the middle of it I want my text to wrap around an image or an advertisement.  If you just align the image to the left or the right your text won’t appear along side it – it ends up giving you a huge chuck of white space.

You can fix that by entering in something like this:

<div style=”float: right;margin: 10px;”>IMAGE CODE OR AD CODE </div>

What that does is it puts 10 pixels of padding around your image/code and floats it to the right.  Your content will wrap around it so it doesn’t make your page look crazy.

Reblog this post [with Zemanta]
Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>