HTML basic questions

HTML basic questions

August 15, 2022
HTML basic questions

HTML Interview Questions

What are semantic tags in HTML5?

  • header, footer, article, aside, details, figcaption, figure, main, nav, section, mark, summary, tima
  • why use semantic tags
    • easier to read
    • greater accessibility
  • ref: Semantic HTML5 Elements Explained

How HTML5 doctype is different from normal html doctype?

How many heading tags are there in HTML5?

Where should script tag be placed in html?

What is the difference between figure and image tag?

How section tag is different from div tag

  • section tag: the content inside is grouped and should appear as a entry in an outline of a page
  • div tag: does not convey any meaning, aside from any found in its class, lang and title attributes.
  • ref: HTML Section Tag

Difference between class and id attribute

What is the difference between canvas and svg?

  • canvas: used to draw graphics
  • svg: used to draw graphics
  • ref: Canvas vs SVG

What you need to add in a html document to make page responsive?

Explain new Form input types in HTML5

  • date: It allows the user to select a date from a drop-down calendar.
  • DateTime: It allows the user to select a date and time along with time zone
  • time: It allows the user to enter time.
  • DateTime-local: It allows the user to select a local date and time
  • week: It allows the user to select a week and year from a drop-down calendar.
  • month: It allows the user to select a month and year from a drop-down calendar.
  • email: It allows the user to enter an e-mail address.
  • tel: It allows the user to enter the phone number with a specific pattern.
  • URL: It allows the user to enter a website URL
  • search: It’s a text field for entering a search string
  • range: It allows the user to range the value with the slider.
  • number: It allows the user to enter a numeric value with the increase and decrease arrow.
  • color: It allows the user to select a color from the color picker
  • ref: HTML5 Form Input Types

What is image map in HTML5?

  • The HTML <map> tag defines an image map. An image map is an image with clickable areas. The areas are defined with one or more <area> tags.
  • ref: HTML Image Map

Difference between <b> and <strong> tag

  • <b>:The bold tag or <b> is also one of the formatting elements of HTML. The text written under <b> tag makes the text bold presentationally to draw attention.
  • <strong>: The strong tag is one of the element of HTML used in formatting HTML texts. It is used to show importance of the text by making it bold or highlighting it semantically.
  • The main difference between these two tag is that the strong tag semantically emphasizes on the important word or section of words while the bold tag is just offset text conventionally styled in bold.
  • ref: Difference between strong and bold tag in HTML

What are the various formatting tags in HTML5?

  • <b> - Bold text
  • <strong> - Important text
  • <i> - Italic text
  • <em> - Emphasized text
  • <mark> - Marked text
  • <small> - Smaller text
  • <del> - Deleted text
  • <ins> - Inserted text
  • <sub> - Subscript text
  • <sup> - Superscript text
  • ref: HTML Formatting Tags

Explain the concept of web storage in HTML5

  • With web storage, web applications can store data locally within the user’s browser.

    • Before HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance.
  • Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server.

  • Web storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.

  • ref: HTML Web Storage API

Explain Meta tags

  • The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.
  • <meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.
  • Metadata will not be displayed on the page, but is machine parsable.
  • Metadata is used by browsers (how to display content or reload page), search engines (keywords), and other web services.
  • There is a method to let web designers take control over the viewport (the user’s visible area of a web page), through the <meta> tag (See “Setting The Viewport” example below).
  • ref: HTML Meta Tags

Explain the <base> tag

  • The <base> tag specifies the base URL to use for all relative URLs in a document.
  • ref: HTML Base Tag

What are the frequently useful API in HTML5?

What are inline elements and block level elements in HTML5?