Most Asked Html Questions
Tags: html
Published: 2021-05-26 08:37:05

**1.Why are you interested in using HTML to build websites?**
Ans:“Web-building tools are great for professional developers, but I think it’s important to understand the underlying technology so I have more control over how sites look and behave. For instance, when I use WordPress to build a site, I often find that I can get better results by inserting my own HTML instead of relying on the provided tools.”

**2.Do you know any other languages that make you a better website developer?**

Ans:Once I started developing larger websites, I learned CSS so I wouldn’t have to update each page’s appearance by hand. I also have some experience with JavaScript. I only know the basic functions, but I can use them to make websites more useful and interactive. I’ve been watching tutorials to make my JavaScript capabilities more robust beside i know bootstrap, React.js, Material ui ,Nodejs , Express js,MongoDB,FireBase Redux and More.  

**3.What’s the difference between a block-level element and an inline element?**

Ans:Each element in HTML is displayed in one of a few ways. By default, most tags are either displayed as block-level or inline. This value can be overridden using CSS.

Block
As the name suggests, a block-level element is drawn as a block that stretches to fill the full width available to it (the width of its container) and will always start on a new line.

Examples of elements that are block-level by default: <div>, <img>, <section>, <form>, <nav>.

Inline
Unlike the block-level elements, inline elements are drawn where they are defined and only take up space that is absolutely needed. The easiest way to understand how they work is to look at how text flows on a page. When a line of text gets to the end of the space available, it wraps onto the next line and happily keeps going. If you were to tack more text onto an existing line of text, it will stay on the same line, as if it was all part of the same text to begin with.

Examples of elements that are inline by default: <span>, <b>, <strong>, <a>, <input>.

**4.Say some about new feature Semantic added to HTML5?**

It introduced a number of semantic elements, which is to say elements that convey meaning. Some of the new semantic elements are <header>, <footer>, <section>, and <article> . They are semantic in that they are not just simple containers, but they tell the browser more about their contents.

There are additional form element types, like "number", "date", "calendar" and "range". Video and audio elements have also been added, as well as new graphic elements, such as <svg> and <canvas>.

**5. What are some of the key new features in HTML5?**

Some features you could mention include:
Improved support for embedding rich content like graphics, audio, and video
The introduction of web workers
New semantic tags including <main>, <nav>, <article>, <section>, <header>, <footer>, and <aside>
Extensions to the JavaScript API
Additional form controls like <calendar>, <dates>, <time>, <email>, <url>, and <search>

Some advantages of HTML5 are:-
It has Multimedia Support.
It has capabilities to store offline data using SQL databases and application cache.
Javascript can be run in the background.
HTML5 also allows users to draw various shapes like rectangles, circles, triangles, etc.
Included new Semantic tags and form control tags.

**6.What are tags and attributes in HTML?**
Tags are the primary component of the HTML which defines how the content will be structured/ formatted, whereas Attributes are used along with the HTML tags to define the characteristics of the element. For example, <p align=”center”>Interview questions</p>, in this the ‘align’ is the attribute using which we will align the paragraph to show in the center of the view.

**7.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.
** 8.Can we display a web page inside a web page or Is nesting of webpages possible?**
Ans:Yes, we can display a web page inside another HTML web page. HTML provides a tag <iframe> using which we can achieve this functionality.

<iframe src=”url of the web page to embed” />