Let the image float to the left/right of a paragraph

Let the image float to the left/right of a paragraph

<!DOCTYPE html>
<html>
<body>

<p> <img src="smiley.gif" alt="Smiley face" style="float:left" width="32" height="32"> A paragraph with an image. The image will float to the left of this text. </p>
<p> <img src="smiley.gif" alt="Smiley face" style="float:right" width="32" height="32"> A paragraph with an image. The image will float to the right of this text. </p>

<p><b>Note:</b> Here we have used the CSS "float" property to align the image; as the align attribute is deprecated in HTML 4, and is not supported in HTML5.</p>

</body>
</html>

Output

A paragraph with an image. The image will float to the left of this text.

A paragraph with an image. The image will float to the right of this text.

Note: Here we have used the CSS "float" property to align the image; as the align attribute is deprecated in HTML 4, and is not supported in HTML5.

ليست هناك تعليقات:

إرسال تعليق