What is a <div> tag?
Experience Level: Junior
Tags: HTML
Answer
The <div>
tag is a container that encapsulates other page elements.
It is great for grouping elements and styling them. The <div>
tag can be completely invisible or can have borders and different background color. It can have margin and padding and is great for creating panels.
<div>
<h2>
BetterCoder.io
</h2>
</div>
Related HTML job interview questions
What is a <p> tag?
HTML JuniorWhat is a <span> tag?
HTML JuniorWhat is a basic structure of the HTML page?
HTML JuniorWhat is the difference between html Element and Attribute?
HTML JuniorHow can you display HTML code of a web application?
HTML Junior