DEV Community

Cover image for Most Asked Html Questions
Iftakher Mahmud
Iftakher Mahmud

Posted on

Most Asked Html Questions

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:

, , , , .

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: , , , , .

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 , , , and . 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 and .

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 , , , , , , and
Extensions to the JavaScript API
Additional form controls like , ,

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,

Interview questions

, 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 and tag in HTML?

tag provides the information about the document. It should always be enclosed in the tag. This tag contains the metadata about the webpage and the tags which are enclosed by head tag like , , , <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.</p>

<p><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.<br>
** 8.Can we display a web page inside a web page or Is nesting of webpages possible?**<br>
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.</p>

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

Top comments (0)