2 replies [Last post]
TrollRG
TrollRG's picture
Offline
newbie
Surrey, BC, CANADA
Last seen: 14 years 38 weeks ago
Surrey, BC, CANADA
Timezone: GMT-8
Joined: 2006-11-08
Posts: 6
Points: 0

I must have read 20 - 30 CSS tutorials and you know what's not mentioned? How does one create a Parent element? Everything is mentioned about how to relate to a Parent but no-one tell us how to make a Parent element, other than "its usually the BODY". I guess I just somehow missed this point. Could someone clarify?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 29 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

And you never will see

And you never will see anything tell you how to create a parent element!

A parent does not exist until it has some children therefore you cannot create a parent first, it comes into existence when you come to give it children.

This is just a term to denote relationships between nested elements or a hierarchy of elements. As are these; Child, Siblings, Parents, Ancestors, Antecedents.

I think you have just got a little confused here.
Body is a child of html, html is the top level all elements under it are children, these are all just terms to help identify a relationship.

When you create your first div after the body tag it's parent becomes 'body' likewise create a div within the first one and then the first one becomes a parent but it's also a child as well, as are we all Smile

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

TrollRG
TrollRG's picture
Offline
newbie
Surrey, BC, CANADA
Last seen: 14 years 38 weeks ago
Surrey, BC, CANADA
Timezone: GMT-8
Joined: 2006-11-08
Posts: 6
Points: 0

Understood

Thanks, Hugo. That was never pointed out to me. It seems this would be fairly important as what attributes you assign to the parent are also given to the children, if you don't signify their own. In every dicipline, when you are into it for awhile, say woodworking, you take for granted the understanding of certain aspects of it, and this caused some folks a problem. (I guess that's why the "_____ for Dummies" books are such a success.)
Again, thanks.
I'm sure I'll have some more questions later. Smile