Auto AdSense

Tuesday, 17 November 2015

Aligning images - HTML Programs

<html>
<body>

<h4>Image with default alignment (align="bottom"):</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" width="32" height="32"> This is some text.</p>

<h4>Image with align="middle":</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" align="middle" width="32" height="32"> This is some text.</p>

<h4>Image with align="top":</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" align="top" width="32" height="32"> This is some text.</p>

<p><b>Note:</b> The align attribute is deprecated in HTML 4, and is not supported in HTML5. Use CSS instead.</p>

</body>
</html>

Output



Image with default alignment (align="bottom"):

This is some text. Smiley face This is some text.

Image with align="middle":

This is some text. Smiley face This is some text.

Image with align="top":

This is some text. Smiley face This is some text.
Note: The align attribute is deprecated in HTML 4, and is not supported in HTML5. Use CSS instead.

Note: Due to inclusion of code to blogpost, images not able to display. But the code will work properly

No comments:

Post a Comment