HTML Tutorial #6: Insert an image in HTML page.
In the previous tutorial we have created a form using <form> tag further we will insert an image.
How to insert an image in HTML element?
=> To create attractive web page we can use images in html element.
An <img> tag is used to insert an image.
In tutorial #3 we have seen about some tags in which <img> tag is empty tag. It does not require closing tag.
<img> requires src and alt attribute.
src:
src attribute defines the source of an image.
alt:
alt attribute is used to specify the alternate text for an image.
* <img src="picture.jpg" alt="pic"> is a syntax to insert images.It should use inside <body> tag.
Open your Notepad and type:
<html>
<head>
<title> insert image </title>
</head>
<body>
<img src="picture.jpg" alt="pic">
</body>
</html>
Save it .html or .htm extension.
But most important point is .html file and all images have been saved in the same folder to easily find the URL.
To define the size of an image width and height attribute can be use in <img> tag.
We use CSS(Cascading style sheet) to decorate HTML element.
But before starting CSS we will know about the VS Code name. This will take us to the standard direction.
To define the size of an image width and height attribute can be use in <img> tag.
But before starting CSS we will know about the VS Code name. This will take us to the standard direction.
Comments
Post a Comment