Interview questions HTML

1. What does HTML stand for?

HTML stands for Hypertext Markup Language.

2. How to create a hyperlink in HTML?

The HTML provides an anchor tag to create a hyperlink that links one page to another page. These tags can appear in any of the following ways:
o Unvisited link – It is displayed, underlined and blue.
o Visited link – It is displayed, underlined and purple.
o Active link – It is displayed, underlined and red.

3. Describe HTML.

Hypertext Markup Language or HTML is a markup language that is used to create website templates or WebPages to present the content on the World Wide Web.
HTML pages are saved by adding .html or .html in web page name.

4. What are some common lists that are used when designing a page?

There are many common lists which are used to design a page. You can choose any or a combination of the following list types:
o Ordered list – The ordered list displays elements in numbered format. It is represented by <ol> tag.
o Unordered list – The unordered list displays elements in bulleted format. It is represented by <ul> tag.
o Definition list – The definition list displays elements in definition form like in dictionary. The <dl>, <dt> and <dd> tags are used to define description list.

5. What is HTML5?

HTML5 is the latest or updated version of the markup language that defines HTML.

6. Which type of video formats are supported by HTML5?

HTML 5 supports three types of video format:
o mp4
o WebM
o Ogg

7. Name some new features which were not present in HTML but are added to HTML5?

Some new features in HTML5 include:
• DOCTYPE declaration: <!DOCTYPE html>
• section: Section tag defines a section in the document, such as a header, footer or in other sections of the document. It is used to define the structure of the document. <section></section>
• header: Header tag defines the head section of the document. A header section always sticks at the top of the document. <header></header>
• footer: Footer tag defines the footer section of the document. A footer section always sticks at the bottom of the document. <footer></footer>
• article: Article tag defines an independent piece of the content of a document. <article> </article>
• main: The main tag defines the main section in the document which contains the main content of the document. <main></main>
• figcaption: Figcaption tag defines the caption for the media elements such as an image or video.<figcaption></figcaption>

8. What is the use of figcaption tag in HTML 5?

The <figcaption> element is used to provide a caption to an image. It is an optional tag and can appear before or after the content within the <figure> tag. The <figcaption> element is used with <figure> element and it can be placed as the first or last child of the <figure> element.

9. Explain the difference between Normalize CSS and Reset Cs ?

Resetting removes all the native styles provided by browsers.
Normalizing is just a correction of some common bugs.
For example:
sup and sub elements will work as usual after normalizing, resetting would make them look like plain text though.
What are sprites, what is their purpose?
CSS sprite is merging multiple images into a single image.
It reduces the amount of WEB-requests and increases page speed.

10. What is Anchor tag and how can you open an URL into a new tab when clicked?

Anchor tag in HTML is used to link between two sections or two different web pages or website templates.
To open an URL into a new tab in the browser upon a click, we need to add target attribute equal to_blank.

11. How can we comment in HTML?

Comments are used by developers to keep a track of the code functionality and also help the other developers in understanding the code functionalities easily.
The commented outlines will not be shown in the browser. To comment a line, the line should start by this <!– and end by this –>. Comments can be of one line or of multiple lines.
For Example:
<!– This is one line comment ?
<!– This is multiple line of two or more line –>

12. What are inline elements and block-level elements in HTML?

Block elements are the blocks that take the full available width and always start from a new line. It will stretch itself to the full available width of the available container width. Block-level elements are <div>, <p>, <img>, <section> and many more.
Inline elements are the elements that will only take the width that is required to fit into the container.
For Example, take the flow of text on the page. When the line of the text takes the full width of the container it wraps itself into a new line and again goes in the same way.
Whereas, the inline element will take only that much space or width that it is needed for them. Inline elements are <span>, <label>, <a>, <b> and many more.

13. What is the reason for wrapping the entire content of a JavaScript source file in a function?

This is a one of best-practices which creates a private namespace and thereby helps avoid potential name conflicts between different JavaScript functions and external libraries.

14. How would you inspect a hover state of an element in the devtools?

To open it click the small :hov text in the top right corner of the styles pane.

15. How would you edit HTML in the devtools?

Right click on the text you want to edit on the HTML pane

16. What are the entities in HTML?

The HTML character entities are used as a replacement for reserved characters in HTML. You can also replace characters that are not present on your keyboard by entities. These characters are replaced because some characters are reserved in HTML.

leave your comment


Your email address will not be published. Required fields are marked *