MyBB Community Forums

Full Version: CSS help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm looking for a piece of code that will align an image and some text next to each other using only divs. The text must aligned to the top of the image.
Here's some basic code that does what you need:
[attachment=2489]
<style type='text/css'>
#left {
width: 200px;
padding: 3px;
float: left;
}

#right {
width: 400px;
padding: 3px;
float: left;
}

.clear {
clear: both;
}
</style>

<div id="left">Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! Image here! </div>
<div id="right">Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! Text here! </div>
<div class="clear"></div>
Thanks. That works perfectly Smile