Vikram is creating a website in which he wants to use different images as links to the web pages.he is also interested in adding some video clips to his website. Can you suggest him the required tags to include the above said elements to his website?
Answers
To create a web page that contains the images and videos, one needs to use the following tags.
1. Image tag <img>
2. Video tag <video>
3. Source tag <source>
Image tag:
Syntax:
<img src="Source link path" alt="alternate text">
Example:
<img src="/desktop/brainly.jpg" alt="Logo of brainly">
<img> is a tag that is used to embed an image on a web page. It mainly contains two attributes 'src' and 'alt' on which 'src' is a mandatory one and 'alt' is an optional one.
'src' takes in the path of the image source and the path is enclosed within quotes.
'alt' is an alternative text of the image source that gets displayed if the image becomes unresponsive or not displayed. It is used to give the user clarity about what exactly the image contains in the absence of the image's display.
Video and Source tags:
Note:
The embedding of the images has started from the version of HTML5. Any version below that doesn't support these tags and one can't embed videos below the version HTML5.
Syntax:
<video controls height="in px or %" width="in px or %">
<source src="Path of video" type="type of the video">
</video>
Example:
<video controls height="200" width="200">
<source src="/desktop/brainly.mp4" type="video/mp4">
</video>
Here, <video> and <source> are the main tags to embed a video on a webpage.
Video tag:
Video is the main tag that says that the video is going to be embedded. The control attribute is a mandatory attribute that gives the video control options like play/pause, seek, etc. Else, the video just displays an image. While height and width are the optional elements with which we can change the resolution of the video.
Source tag:
Source tag is a sub-tag of video tag that takes in the video source through its path and dumps it into the src tag. So, here src tag is mandatory to take in the path of the video for embedding it on the page. While type attribute is used to specify the video's extension and it is optional.
Learn more:
1. The correct sequence of HTML tags for starting a webpage is
brainly.in/question/31109764
2. What is the correct HTML for adding a background color
brainly.in/question/27607956