Horje
How to create HTML Image Floating

Use the CSS float property to let the image float to the right or to the left of a text:


Full Example of HTML Image Floating

Smiley face A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Floating Images</h2>
<p><strong>Float the image to the right:</strong></p>

<p>
<img src="https://itupto.com/avatar.png" alt="Smiley face" style="float:right;width:42px;height:42px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
</p>

<p><strong>Float the image to the left:</strong></p>
<p>
<img src="https://itupto.com/avatar.png" alt="Smiley face" style="float:left;width:42px;height:42px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.  
</p>

</body>
</html>

Output should be:

Full Example of HTML Image Floating
Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_images_float





Related Articles
What is HTML Images HTML Images
How to create HTML Images Syntax HTML Images
How to create The src Attribute for Image HTML Images
How to create HTML The alt Attribute for Image HTML Images
How to create Image Size - Width and Height HTML Images
How to create HTML Image Width and Height with CSS Style HTML Images
How to create HTML Images in Another Folder HTML Images
How to create HTML Images on Another Server/Website HTML Images
How to create HTML Animated Images HTML Images
How to create HTML Image as a Link HTML Images
How to create HTML Image Floating HTML Images

Single Articles
Full Example of HTML Image FloatingHTML Images

Read Full:
HTML Images
Category:
Web Tutorial
Sub Category:
HTML Images
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
36



Share on: