September 4, 2009 in Coding Tricks by Jerry


Here is how you can easily float an images either to the right or left inside a wordpress post.

First, locate the css file of your wordpress theme:

www.YourWebsite.com/wp-content/themes/YourTheme/style.css)

Second, open the file with an html editor or notepad and add a new class…

Add this at the bottom of your css file to define a new class:


.float {

float:right;

padding: 5px;

}

Third, when writing a new post in wordpress put this code around the code of your image:

<div class=”float”>Your Image Code Goes HERE</div>

And that’s it.

You can even use the same exact code to float adsense adds inside your wordpress posts.

Tags

css float, css float image, css float image right, css float right, float html css, float image in css, float images css, image float