Quick Contact

    HTML Interview Questions

    Q1. What is HTML?

    HTML is an abbreviation for Hyper Text Markup Language. It is a World Wide Web language. This is a text formatting language that is utilized to establish and demonstrate Web pages. It adds to the text’s interactivity and dynamic nature. It can convert text to images, tables, and links.

    Q2. What are tags and attributes in HTML?

    Tags seem to be the key characteristic of HTML which specify how the content will be organized, whereas Attributes are utilized in combination with HTML tags to describe the element’s qualities. For instance, p align=”center”> Interview questions< /p>In this case, the ‘align’ characteristic will be used to align the section so that it appears in the centre point of the view.

    Q3. What are void elements in HTML?

    Void components are HTML elements that do not have forced to close tags or are not required to be concluded. For example, < br />, < img />, < hr />, and so on.

    Q4. What is formatting in HTML?

    HTML consistency is the procedure of page layout text to make it appear and feel more professional. It employs various tags to make text bold, italicized, and highlighted.

    Q5. How many types of heading does an HTML contain?

    The < h1> to < h6> tags define the six different types of headings in HTML. Each type of heading tag has a different text size than the others. As a result, < h1> is the greatest heading tag and < h6> is the smallest. As an example:

    < h1>Heading no. 1< /h1>

    < h2>Heading no. 2< /h2>

    < h3>Heading no. 3< /h3>

    < h4>Heading no. 4< /h4>

    < h5>Heading no. 5< /h5>

    < h6>Heading no. 6< /h6>

    Q6. Describe HTML layout structure.

    The HTML layout describes how all of the elements in the document are organized. It is an essential component of basic page design and is required when developing a website in order for it to appear professional and appealing. Every website has a unique layout that allows it to display content in a specific way. The HTML elements listed below are used to define the various parts of a webpage:

    • < header>: define a header for a document or a section.
    • < nav>: defines a container for navigation links
    • < section>: it defines a section in a document
    • < article>: define an independent, self-contained article
    • < aside>: it defines content aside from the content
    • < footer>: define a footer for a document or a section
    • < details>: define additional details

    Q7. What are the various formatting tags in HTML?

    HTML has various formatting tags:

    • < b> –

      makes text bold

    • < i> –

      makes text italic

    • < em> –

      makes text italic but with added semantics importance

    • < big> –

      increases the font size of the text by one unit

    • < small> –

      decreases the font size of the text by one unit

    • < sub> –

      makes the text a subscript

    • < sup> –

      makes the text a superscript

    • < del> –

      displays as strike out text

    • < strong> –

      marks the text as important

    • < mark> –

      highlights the text

    • < ins> –

      displays as added text

    Q8. What are the different kinds of Doctypes available?

    The three kinds of Doctypes which are available:

    • Strict Doctype.
    • Transitional Doctype.
    • Frameset Doctype.

    Q9. Difference between < strong>, < b> tags and < em>, < i> tags?

    The effect of the tags < strong>, < b>, and < em>, I on a normal webpage is the same. The < b> and I tags stand for bold and italic, respectively. These two tags only apply text styling, and the bold tag < b> simply adds more ink to the text; neither of these tags says anything about the text.

    Whereas the < strong> and < em> tags indicate that the timeframe of text is of greater importance or resounding stress than just the rest of the text. These tags have linguistic significance.

    Q10. What is the significance of < head> and < body> tag in HTML?

    < head> tag provides the information about the document. It should always be enclosed in the < html> tag. This tag contains the metadata about the webpage and the tags which are enclosed by head tag like < link>, < meta>, < style>, < script>, etc. are not displayed on the web page. Also, there can be only 1 < head> tag in the entire Html document and will always be before the < body> tag.

    < body> tag defines the body of the HTML document. It should always be enclosed in the < html> tag. All the contents which needs to be displayed on the web page like images, text, audio, video, contents, using elements like < p>, < img>, < audio>, < heading>, < video>, < div>, etc. will always be enclosed by the < body> tag. Also, there can be only 1 body element in an HTML document and will always be after the < head> tag.

    Q11. Do all HTML tags have an end tag?

    No, not all HTML tags have an end tag. The < br> tag, for e.g., is used to split a line, and the < image> tag is utilized to introduce an image into a document. Individuals are self-closing tags that do not enable an end tag.

    Q12. Write the basic structure of the HTML template.

    The basic structure of the HTML template is:

    < html>
          < head>
                    < title>Title of the page< /title>
          < /head>
          < body>content of the page< /body>
    < /html>

    Join HTML Live Project based training with Ducat India.

    Q13. Which HTML tag is used to display the data in the tabular form?

    The HTML table tag displays data in tabular format (row * column). It also handles the page’s configuration, such as the main page, navigation menu, body content, and footer section. Here is a list of tags that were used when presenting data in tabular form:

    Tag Description
    < table> It defines a table.
    < tr> It defines a row in a table.
    < th> It defines a header cell in a table.
    < td> It defines a cell in a table.
    < caption> It defines the table caption.
    < colgroup> It specifies a group of one or more columns in a table for formatting.
    < col> It is used with < colgroup> element to specify column properties for each column.
    < tbody> It is used to group the body content in a table.
    < thead> It is used to group the header content in a table.
    < tfooter> It is used to group the footer content in a table.

    Q14. What is semantic HTML?

    Semantic HTML is a type of programming. It is the application of HTML markup to strengthen the semantic information or understanding of the content. As an example: In semantic HTML, the < b>< /b> tag is not utilized for bold statements, and the < i>< /i> tag is used for italic statements. Instead, we use the < strong>< /strong> and < em>< /em> tags.

    Q15. What are HTML Attributes?

    HTML attributes supplement the information provided by HTML elements. Participants are defined immediately following the tag name. Those who seem to only in opening tags and never in closing tags.

    HTML attributes are typically composed of name/value pairs such as name=”value.” Parameters must always be surrounded by quotation marks. The name parameter is used to specify the identity of the property that will be designated to the element. The property value or the amount of the property identities which can be connected over the element is used as the value.

    Q16. What is a style sheet?

    A style sheet is utilized to create a compliance, portable, and visually appealing style framework. These frameworks can be utilized on a variety of web pages. It describes the appearance and typesetting of a markup-language document.

    Q17. Difference between link tag < link> and anchor tag < a>?

    The anchor tag < a> is utilized to generate a hyperlink to another website or a specific section of a website, and all these connections are accessible, while the link tag < link> describes a link between such a document and an important in choosing, and these links are not clickable.

    Q18. When to use scripts in the head and when to use scripts in the body?

    If the scripts include any event-triggered operations or the jquery library, we should incorporate them in the head tag. If the script publishes information to the page or is not contained within a component, it needs to be placed at the bottom of the body section. In summary, here are three points:

    1. In the head section, place librarian scripts or event scripts.
    2. Place standard scripts in the head tag which do not publish anything to the page until there is a quality issue.
    3. Scripts which represent the contents of the web page should be placed at the bottom of the body section.

    Q19. What is a marquee?

    On a website page, a similar area is used to display scrolling text. It immediately normally goes the image or text up, down, left, or right. Inside the < marquee>……< /marquee> tag, placed the text that you want to scroll.

    Q20. What are the entities in HTML?

    HTML Entities objects are utilized in HTML to renew restricted characters. Enterprises can also be used to substitute characters that aren’t on the keyboard. Because certain HTML characters have been reserved, these letters are modified.

    Q21. Why is a URL encoded in HTML?

    Because URLs are only sent through the Internet using the ASCII character set, they must be encrypted to transform non-ASCII personalities into a template that can be utilized over the Internet. If a URL includes characters that are not in the ASCII set, it must be transferred. Non-ASCII characters are substituted with a “%” followed by hexadecimal digits.

    Q22. Describe HTML5 and their new features that were not present in HTML?

    HTML5 is the most recent version of the Hypertext Markup Language (HTML). HTML5’s new features include the following:

    • SVG, canvas, as well as other simulated vector graphics are supported by HTML5. Vector graphics could only be utilized with Flash, VML (Vector Markup Language), or Sharepoint in HTML.
    • HTML5 enables the execution of JavaScript within a web browser. JavaScript was previously permitted to run in the browser interface thread.
    • HTML5 does not use SGML. It includes improved parsing rules for greater compatibility.
    • Web SQL databases are used in HTML5 to temporarily store data. Previously, only the browser cache was employed.
    • The following elements have been removed: applet, isindex, noframes, acronym, dir, font, frame, frameset, and big.
    • Time, summary, aside, audio, command, and data are new elements.

    Q23. What happens if you open the external CSS file in a browser?

    When users attempt to open the external CSS file in a web page, it will not open. This is due to the fact that the document has a containing different. The only thing to utilize an external CSS file is to associate it all within another HTML document by using < link/> tag.

    Q24. Which tags are used to separate a section of texts?

    To differentiate a category of text, the following three identifiers are used:

    • < br> –

      used to break up a line of text. It interrupts the current line and directs the flow to the next line.

    • < p> –

      It is a new paragraph that contains the text.

    • < blockquote> –

      specifies a long quoted section.

    Q25. Explain the use of an iframe tag.

    The inline frame is specified by the < iframe> tag. It is employed to show a web page inside another website page (to embed another document within the current HTML document).

    For example, the src attribute specifies the URL of the document that is contained within the iframe.


    < iframesrc=”URL”>< /iframe>

    Q26. What is the difference between LocalStorage and SessionStorage Objects?

    The following are the distinctions among both LocalStorage and SessionStorage Objects:

    LocalStorage Object SessionStorage Object
    1. It stores data that has no expiration date. 1. Only store information for one session.
    2. The information can be shared across multiple browser windows. 2. Data is only available in the current browser window.
    3. When the web browsing window is closed, no data is deleted. 3. If the web browsing window is closed, the data is deleted.

    Q27. What is URL Encoding? Why are URLs encoded in HTML?

    URL Encoding is the method of converting non-ASCII personalities in URLs to a template that web browsers can understand. The ASCII personality set is used to send URLs over the Internet. If a URL incorporates characters that are not in the ASCII set, it must be converted.

    HTML encodes URLs by converting non-ASCII personalities into a template which can be transmitted through the internet. Non-ASCII characters are replaced with a “%” followed by hexadecimal digits in the URL encoding.

    Q28. What is the use of the figure tag in HTML 5?

    The < figure> tag is used to identify self-contained material that is related to the main content. It is utilized to include self-contained content such as photos, diagrams, illustrations, and so on. The figure, its caption, and its contents are all referred to as a single unit in the document’s main flow. The imgsrc and figcaption elements are part of the < figure> tag. Imgsrc is used to insert an image source into a document, whereas figcaption is used to change the caption of an image.

    Q29. What are HTML entities?

    HTML entities are a collection of characters was using to demonstrate restricted and untouchable characters in HTML. These strings begin with an ampersand (&) and end with a semicolon (;). Users can also be utilized to replace some difficult-to-type characters on a standard keyboard.

    Syntax: &entity_name; or _number;

    Q30. What is the canvas element in HTML5?

    The “canvas” component is a compartment for attempting to draw visual content on web pages that uses a scripting language including such JavaScript. It allows for the dynamic and attempt to establish rendering of bitmap images and 2D shapes. There are numerous ways to draw pathways, boxes, circles, text, and images on canvas.

    Q31. What is the difference between < em>, < i> and < strong>, < b> tags?

    On a traditional website page, the implications of the tags < strong>, < b>, and < em>, I are identical. The tags < b> and I indicate italic and bold text. These two tags do nothing more than apply font styles, whereas the bold tag (< b>) simply adds ink to the text.

    While the < em> and < strong> tags imply that a component of text is more essential than other content in terms of significance and emphatic emphasis.

    Q32. What is the difference between < div> and < span> tag?

    The span and div components differ because the spacing component is in-line and is usually used to display a short paragraph or perhaps another small block of HTML within a line. A div or division component, on the other hand, is a frame line with a punctuation mark before and after it that is used to combine larger sections of code.

    Q33. What is the use of Geolocation API in HTML5?

    Geolocation API, which is employed to establish the geographical location of an individual for a web – based application, is one of the best HTML5 APIs. HTML5 now allows you to navigate to the visitor’s current website’s latitude and longitude coordinates. JavaScript can record these exact location and send them to the server, enabling it to showcase your position on the page. Navigation makes use of the geolocation API. ageolocated object The read-only property of the object returns a Geolocation entity that contains the user’s location information and can produce a customized consequence.


    var geolocation = navigator.geolocation;

    Join HTML Live Project based training with Ducat India.

    Q34. What is an SVG tag in HTML? Give Example.

    HTML SVG is an abbreviated form for Scalable Vector Graphics. To explain visuals in XML, a modular design language called HTML SVG is used. XML defines vector and composite vector/raster graphic elements in two dimensions. It is from the World Wide Web Consortium. The actions of SVG images are defined by text files containing XML. Because SVG images can be created and edited as XML files, they can be done with a text editor, but drawing applications like Iinkspace are usually preferred for this purpose.

    Q35. What is data transfer API?

    The Data Transfer API handles the management of digital transactions from one user to another across a domain. This transmission can be used to reallocate implementation data belonging to a user who has left the company, for example. To use the Data Transfer API, you should first define a transfer before beginning it with the insert method. The transfer may include application-specific parameters and is described in terms of one or more apps whose data will be sent.

    • Select the application(s) toward which users want to send data.
    • Create a transmission resource that includes a list of users at the source and the destination, as well as the programmes for which the data will be sent.
    • Use the attach procedure to add the transfer request.

    Are you prepared to pursue a career in HTML. You can check out our HTML Career Opportunities tutorial.

    Copyright 1999- Ducat Creative, All rights reserved.

    Anda bisa mendapatkan server slot online resmi dan terpercaya tentu saja di sini. Sebagai salah satu provider yang menyediakan banyak pilihan permainan.