+ 7
HTML: <div> explanation
I've been helping people out with many Languages for a while now, but there's always one question where I answer "It's a block element where you can control other elements in it" leaving them even more confused. How do you properly explain what a <div> element does?
6 Antworten
+ 13
The <div> tag defines a division or a section in an HTML document, it is used to group elements to format them with CSS.
Example:
<div style="color:green">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</div>
The text in <h1> and <p> are green.
+ 11
It is a container for other elements and objects that you can use it to refer to all other elements inside it or you can refer and style or change other elements in it
And it acts as a block or box that can hold any type of data or information....!!
+ 8
I'm not really sure whether this be a correct answer nor would it help by explaining, this is just my personal view, others may have different points & views on this matter.
A div is an element that provides support for dividing the HTML document content into smaller views, or creating invisible areas that can be shown as necessary. Basically it's something that supports page content division, hence the name "div"?
Hth, cmiiw
+ 3
post it into Playgrounds, then ask your question in the QnA section with your code's link.
@Muaffak ADLI
- 2
l kill you