
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use an animated image in HTML page?
Animated images in HTML are an image on a web page that moves. It is in GIF format i.e. Graphics Interchange Format file.
We need to use the <image> tag with the src attribute to add an animated image in HTML. The src attribute adds the URL of the image (file destination).
Also, we can set the height and width of the image using the height and width attribute.
Syntax
<image src=”Animated image”>
Example 1
Following is an example to show how to use an animated image in HTML page −
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="description" content="meta tag in the web document"> <meta name="keywords" content="HTML,CSS"> <meta name="author" content="lokesh"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <p>Adding Animated Images to the web page</p> <img src="https://tutorialspoint.com/images/html.gif"> </body> </html>
Example 2
You can try to run the following to work with the animated image in HTML −
<!DOCTYPE html> <html> <head> <title>Animated Image</title> </head> <body> <h1>Animated Image</h1> <img src="https://media.giphy.com/media/3o6UBpHgaXFDNAuttm/giphy.gif"> </body> </html>
Example 3
We can change the height and the width of the animated image using the style sheet.
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="description" content="meta tag in the web document"> <meta name="keywords" content="HTML,CSS"> <meta name="author" content="lokesh"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <p> dding Animated Images to the web page</p> <img src="https://tutorialspoint.com/images/html.gif" height="200" width="200"> </body> </html>
- Related Articles
- How to use floating image in HTML page?
- How to Insert an Image in HTML Page?
- How to use image height and width attribute in HTML Page?
- How to use JavaScript to redirect an HTML page?
- How to plot an animated image matrix in matplotlib?
- How to use Meta Tag to redirect an HTML page?
- How to use title tag in HTML Page?
- How to use href attribute in HTML Page?
- How to use an image as a link in HTML?
- How to create an Animated bars using HTML and CSS?
- How to use the tag to define style information for an HTML page?
- How to use icons to make an animated effect with JavaScript?
- How to use the tag to define the base URL for an HTML page?
- How to redirect from an HTML page?
- How to display an image in HTML?

Advertisements