The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Div children elements, I need help
tyronebiggums
post Mar 26 2020, 01:21 PM
Post #1





Group: Members
Posts: 1
Joined: 26-March 20
Member No.: 27,252



Write one div container tag with three div children tags with class elements left_child, middle_child and right_child


So I'm doing an assignment and I have no clue what to do here please help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 26 2020, 02:28 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I don't think I can say it much clearer. Except that calling a DIV a tag in this context is stupid. There's a start tag and a closing tag for the DIV. You can't put three other DIVs in those. The whole thing, start tag, closing tag and content, is called an element (you can tell your teacher if you want).

But OK, I'll try to rephrase that assignment.

You type the start tag and end tag for a DIV that will be your container DIV. In that DIV (and that means between the start and closing tags) you type the start and closing tags for three other DIVs.

To make it easier to read and understand type the start tag for the container DIV on one row, hit ENTER a few times and type the closing tag. Congratulations, you have now created an element! tongue.gif
Then place the cursor on an empty line between the two tags you just typed and type a new start tag and closing tag for DIV.
Hit ENTER and type a new set of start and closing tags.
Do the above once again.
There, you now how three DIVs contained in an outer DIV.

Then put the cursor at the end of the start tag of the first of the three DIVs that are contained in the "container DIV", just before the '>'. Type class="left_child".
Do the same for the two remaining DIVs inside the "container DIV", but name the classes middle_child and right_child respectively.

Type that and paste it below and we'll see if you got it right. happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 26 2020, 02:31 PM
Post #3


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
Write one div container tag
Here you go:
CODE
<div>
...
</div>
Technically, that's two tags: the opening <div> tag and the closing </div> tag. The whole thing is one DIV element.

QUOTE
with three div children tags
Here you go:
CODE
<div>
<div>...</div>
<div>...</div>
<div>...</div>
</div>
That's three children DIV elements, each with its own opening tag and closing tag.

QUOTE
with class elements left_child, middle_child and right_child
Note that CLASS is not an element; CLASS is an attribute. The "div container" is an element, and the "three div children tags" are also elements. Each of these DIV elements has its own opening tag and closing tag. The attributes go in the opening tags.

Also, "left_child" and "middle_child" and "right_child" are poor choices for class names. Something more meaningful like "navbar" or "sidebar" would be better.

But here you go:
CODE
<div>
<div class="left_child">...</div>
<div class="middle_child">...</div>
<div class="right_child">...</div>
</div>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 11:02 AM