Slide 1
Slide 2
Slide 3

Animation images and alignment in HTML5 (HTML-V42)

No Comments

10.5. Image Alignment
By default, an image is aligned to the left side of the page, but you can use the align attribute to place it in the center or on the right.

10.6. Animated Images
You can also use animated images with the .gif extension on a web page. You don't need any special attribute to display an animated image. Just put the URL (path) of the .gif image in the src attribute.

Source Code:

Copied!
<!DOCTYPE html>
<html>
<head>
    <title>Image Alignment and Animation</title>
</head>
<body>

    <h3>Left Alignment (Default)</h3>
    <img src="animate/570.gif" alt="Animated Image" width="200" height="150">

    <h3 align="center">Center Alignment</h3>
    <p align="center">
        <img src="animate/280.gif" alt="Animated Image" width="200" height="150">
    </p>

    <h3 align="right">Right Alignment</h3>
    <p align="right">
        <img src="animate/570.gif" alt="Animated Image" width="200" height="150">
    </p>

</body>
</html>

Result:  

Watch the video:


Ebook:
https://softkhpc.blogspot.com/2026/11/html-tutorial-beginners.html

back to top