Forum Moderators: not2easy

Message Too Old, No Replies

Set a root element

Setting a root element

         

jmoreira

2:36 am on Jul 7, 2004 (gmt 0)

10+ Year Member



Hello folks,

I'm developing my personal website in CSS which has been more complicated than any business website I have developed as far as content. I'm using div's instead of tables. But there's one thing that I havent understood well, containing element and root element. How do I set the root element or containig element?

Thank you!

DrDoc

2:52 pm on Jul 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

The beauty of your question is -- you don't have to! ;)
The "containing element" and "root element" already exist... So, where are they, and how do I find them? Well, let me give you a couple examples.

<p>foobarbaz</p>

What is the containing element of the text string
foobarbaz
? Well, obviously it is the paragraph. Easy, eh? Now, what about this:

<div> 
<p>foobarbaz</p>
</div>

Again, the paragraph is the containing element of
foobarbaz
. The div is the containing element of the paragraph. This also means that the div is a containing element of the string
foobarbaz
. Ok, containing elements don't seem to be a problem... What about root elements?

In short, the root element is the outermost containing element. So, for any normal webpage,

html
is the root element.

<html> 
<head>
<title>test page</title>
</head>
<body>
<p>some text goes here</p>
</body>
</html>

html = root element, containing element of head and body
head = containing element of title
title = containing element of 'test page'
body = containing element of paragraph
paragraph = containing element of 'some text goes here'