Advance HTML Tags
In this article, we saw some advance HTML tags.
Before we move on HTML tags, It is important to know that HTML is case sensitive or not, What is case sensitive ?, In almost all programming languages case sensitivity exist , So case sensitive tells that is lowercase and uppercase same or different ex - A and a same or not.
HTML is a case sensitive markup language. Ex - <h1> and <H1> both are same, But the correct way to write programming language , follow the case sensitivity of any programming language. This is the correct way to write code.
Now let's continue with tags, We discussed some basics tag in previous article like h (heading), p (Paragraph) , i (Italic) , b (Bold) , u(Underline) etc.
Today we are discussing following tags :-
pre, img, audio, video, embed, div, span, hr etc.
• pre - HTML ignore white spaces and line break by default. But if you want to display content in web browser as written in code section you can pre tag.
• img - ing tag is basically used to add images in an HTML pages and one more important subtag of img tag called , alt also known as alternative text, It is used only when if by chance while loading your website because of some problem image didn't load So as caption alt ="demo-image", this content will show
Syntax - <img src="location or path of image" alt = "alt text" />
• audio - It is used to add mp3 sound in a webpage. Also many attributes of audio tag. Ex - autoplay, controls etc
Syntax - <audio src="location of mp3 file" autoplay ></audio>
• div - It is used as containers for other elements like inside div we can put images, text, table, form etc. And it is a block level element (Takes full width, and browser by default give line break after div or any block element)
Syntax - <div>Content</div>
• span - It is also use as container or define part of a document.
Recommended by LinkedIn
Syntax - <span>Part</span>
• hr - Used to draw horizontal line after section or part of webpage. Also known as horizontal rule Syntax - <hr>
• video - It is used to display video in webpage. In video tag we can specify many attributes like controls (like volume up /down , full screen mode), autoplay etc.
Syntax -
<video width= "" height="" controls ="controls" autoplay = "autoplay">
<source src = "demo.mp4" type = "video/mp4">
• embed - It is also used to display video in a webpage.
Syntax - <embed src= "demp.mp4" width="" height = "">
embed vs video
Very smaller difference between both, In embed tag, there is no full screen mode option while video tag there is also full screen mode available. So video tag is more effective than embed.
Thanks for reading this article.