how to align div containing text and image to center
<p>I want to do following:</p>

<ul>
<li>A div containing an image 50x50 and text next to it of font 25px.</li>
<li><p>Image and text should align in middle.</p></li>
<li><p>The div containing image and text should align to center of it parent.</p></li>
</ul>

<p>I tried the followint but it does not give the desired result.</p>

<p>What needs to be done?</p>

<p><a href="http://www.w3schools.com/css/tryit.asp?filename=trycss_layout_float" rel="nofollow">http://www.w3schools.com/css/tryit.asp?filename=trycss_layout_float</a></p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
img {
    float: center;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;p align="center"&gt;&lt;img src="w3css.gif" alt="W3Schools.com" width="50" height="50"&gt;
Lorem .&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>