What is the physical meaning of <div> element? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the physical meaning of <div> element?

When learning about this inline and block learning, div element came up. It is given that <div> element is used as a container for other elements. What does it mean? By 'container' what are they conveying?

14th Jul 2018, 9:24 AM
Raghunath Thiagarajan
Raghunath Thiagarajan - avatar
8 Answers
+ 2
Raghunath Thiagarajan <div> is a container of other elements because you could put in other elements in it. Example <did id="header"> <h3>Welcome To Sololearn</h3> </div> Div is a short for "Division"
14th Jul 2018, 9:35 AM
Dlite
Dlite - avatar
+ 1
Is it because attributes need an element to function?
14th Jul 2018, 9:58 AM
Raghunath Thiagarajan
Raghunath Thiagarajan - avatar
+ 1
I don't understand
14th Jul 2018, 9:59 AM
Dlite
Dlite - avatar
+ 1
You could write the code with or without using any attribute
14th Jul 2018, 10:24 AM
Dlite
Dlite - avatar
+ 1
from: https://www.w3schools.com/Tags/tag_div.asp " The <div> tag defines a division or a section in an HTML document " How I think of a container is like a bucket. So let us use an example. I have a Blue bucket and a Brown bucket. In the Blue bucket I have Apples and Pears.In the Brown Oranges and Lemons. You are my Shop styler. I tell you to put the Blue bucket on the top shelf and the Brown bucket on the bottom shelf. The writing of it can be thought of similar to brackets in C. { //opening bracket Stuff inside brackets } // closing bracket So buckets above in HTML would be written as. <div class="Blue Bucket"> <!--This is the beginning of my blue bucket--> Apples<br> Pears </div> <!-- this is the end of my blue bucket, everything inside is contained within the blue bucket --> <div class="Brown Bucket"> <!--This is the beginning of my brown bucket--> Oranges<br> Lemons </div> <!-- this is the end of my brown bucket, everything inside is contained within the brown bucket-->
14th Jul 2018, 12:36 PM
Louis
Louis - avatar
0
Attributes like header can't be written simply, right?
14th Jul 2018, 10:23 AM
Raghunath Thiagarajan
Raghunath Thiagarajan - avatar
0
Maybe try: http://dustwell.com/div-span-inline-block.html And, yeah, "style" is an attribute (you can think of it like a trait). Attributes are expressed through elements. "display" is a property of an attribute. "inline" and "block" are acceptable values for the "display" property.
14th Jul 2018, 10:26 AM
Janningā­
Janningā­ - avatar
0
Thank you so much. Gave me a clear picture
17th Jul 2018, 3:42 PM
Raghunath Thiagarajan
Raghunath Thiagarajan - avatar