div in a div with class name
<html> <head> <style type="text/css"> body { background-color: #fff; } div.imgholder { float: left; background: red; margin: 0 7px 7px 0; } div.imgholder div { background: blue; padding: 0 6px 6px 0; } div.imgholder img { display: block; position: relative; background-color: #fff; border: 1px solid #666; padding: 2px; } </style> </head> <body> <div class="imgholder"> <div> <img src="http://www.java2s.com/style/logo.png" alt="Photo" /> </div> </div> <h2>Adipiscing Elit</h2> </body> </html>