Archive for October 14th, 2005

Administrator

Wrapping Text Around Images

I have added the capability to wrap text around my images. Although it does not work well when you have multiple images and not a whole lot of text, it still is nice to have this feature. Here is the code to go in your styles.css in your theme folder for Wordpress (make sure you don’t already have this)

//This sets the border color and thickness around your image
img {
border:solid green 1px;
}

//This sets the border for when you want to hover over an image
a:hover img {
border: dashed green 1px;
}

//this is for setting a border if the image is a link
//it's current set to no border
a img {
border:0;
}

//sets the padding around the image
p img {
padding: 0;
max-width: 100%;
}

//right justification
img.right {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

//left justification
img.left {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.right { float: right }
.left { float: left }
//centering image
img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

And this is how you would use it if you were to left justify your image

<img src="http://www.halfzware.com/wordpress/wp-content/thumb-FrontHouseBefore.jpg" <b>class="left"</b> alt="Front Of House Before "/>