Home >>Interview Questions >HTML Interview Questions
Hypertext Markup Language or HTML is a markup language of World Wide Web. It is a standard text formatting language which is used to create webpages and display website pages on the web. You can save the HTML pages by adding .htm or .html.
HTML5 is the fifth version of HTML. It is a standard for structuring content on the web pages. HTML5 has removed or modified many elements. It also handling inaccurate syntax.
Many new elements are added in HTML5 like nav, audio, embed, progress, command, time, summary, video, output, figure, meter, data, section, time, aside, canvas, rp, rt, details, figcaption, header, footer, article, hgroup, bdi, mark, source, track, section etc.
Most tags must have two parts: opening tag and closing tag and text are written inside these tags. But closing tag needs an additional forward slash( / ).
For example:
<h1>text goes here…</h1>
There are six types of heading <h1> to <h6> you can used in HTML. <h1> display largest heading and <h6> display small heading to the web page.
For example:
<h1> First heading</h1> <h2> Second heading</h2> <h3> Third heading</h3> <h4> Fourth heading</h4> <h5> Fifth heading</h5> <h6> Sixth heading</h6>
No, there are two tags which don't have an end tag <img> and <br> tag.
HTML5 ‘nav’ tag represents the menu bar on the top of the web page. It helps user easily go to the page where he want to go.
These are the common list you can use in HTML:
Note: Each list item starts with <li>tag.
Attributes are used inside the HTML tags. You cannot use attributes in all tags but some tags needs attributes like-
<img src="">
<input type="">
'Src' and 'type' are called attributes in HTML.
Comments are used by developers in understanding the code functionalities. It is also helpful for other developers to easily read the code.
There are two types comments used in HTML:
<--single line comment-->
Multiple line comment- <! -- Text goes here…. Text goes here -->
<! DOCTYPE> is an instruction to the web browser about the version of markup language in which the HTML page is written in. the <! DOCTYPE> tag does not need an end tag and it is not case sensitive.
By using © and © in an HTML file, you can insert a copyright symbol on a browser page.
No, the browser is not be able to read the page that the document is written in HTML or HTML5 that’s why tags do not function properly.
It is used to create a clickable button on the web page. The button tag is introduced in HTML 5. Generally button is used in forms to submit or cancel the details.
Three types of video formats supported by HTML 5:
Marquee tag is used for scrolling the text or image on the web page. It is helpful to scroll the text or image up, down, left, or right. You can put the text or image within the marquee tag which you want to scroll.
Let's see examples: <Marquee> text goes here…. </marquee>
Placeholder helps the user to easily understand that what can be entered in the field. Placeholder does not take extra space, you can see it inside the input field.
Provide useful information to our web pages are known as meta tags.
Meta tag includes following:
This tag is used to add an image in the document of the web page.
<Output> tag is used to display the different output and result.
<!DOCTYPE html> <html> <body> <h2>Video</h2> <video width = "350" height = "300" controls> <source src = "MyMovie.mp4" type = "video/mp4"> </video> <h2>Audio</h2> <!DOCTYPE html> <html> <body> <audio controls> <source src = "song.mp3" type = "audio/mpeg"> </audio> </body> </html> </body> </html>
Hyperlink is a link that allows the user to move from one page to another by clicking the link. You can apply hyperlink on text as well as images.
<!DOCTYPE html> <html> <head> <title> Hyperlink </title> </head> <body> <a href = "https://www.google.com/" target = "_blank"> <img src = "google.png" alt = "google" border = "0/"> </a> </body> </html>
These are the following formatting tags in HTML5:
SVG stands for Scalable Vector Graphics. It helps to describe two-dimensional vector and raster graphics. SVG images are defined in XML text files. It is mostly used for vector type diagrams like pie charts, 2-Dimensional graphs in an X, Y coordinate system.
<svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="blue" stroke-width="4" fill="green" /> </svg>
It displays the text in inline, doesn’t break line. You can use it for adding color, background color, highlight the text in the web browser and also you can use it for adding the icons to your text.
<p> <span style="color: #cccccc ;"> In this page we use span. </span> </p>
Style sheet is an external file for styling the template. It is consistent and transportable. It stored all the styling of the template in one file.
Nested represents a webpage within a webpage. For nesting the web page you can use the <iframe> tag.
<!DOCTYPE html> <html> <body> <h2>Nested webpage </h2> <iframe src="https://www.phptpoint.com/" height="300" width="400"></iframe> </body> </html>