Page 1 of 1

Help Forum

Posted: Mon May 28, 2018 3:17 pm
by Vee
Please post here if you have any curriculum questions!

Re: Help Forum

Posted: Mon May 28, 2018 3:18 pm
by Vee
Does anyone here understand relational selectors? I don't quite get how the relationships are formed; like, is the <a> tag always a child tag of <li> or is it based on design and the container organization? Are there some tags that inerit or is it just what's next to it? Thank you in advance!

Re: Help Forum

Posted: Mon May 28, 2018 3:25 pm
by james
Hay ... tags form groups: some stand alone... some have to have some inner tags to support what they are all about.

<ol> is an ordered list tag it starts <ol> and it ends </ol>

... but it can't exist alone. It has to have AT LEAST one of these guys <li>

<li> is a list item tag it starts <li> and it ends </li>

it can't exist alone either.

<ol>
<li>This is the first item of the ordered list</li>
<li>This is the second item of the ordered list</li>
</ol>

Some tags need each other.

Re: Help Forum

Posted: Mon May 28, 2018 3:37 pm
by james
Vee wrote:
Mon May 28, 2018 3:18 pm
Does anyone here understand relational selectors? I don't quite get how the relationships are formed; like, is the <a> tag always a child tag of <li> or is it based on design and the container organization? Are there some tags that inherit or is it just what's next to it? Thank you in advance!
The <a> is the anchor tag. It has nothing to do with the <li> List item tag. The <a> tag forms a link. The <li> tag is a List Item in a list of items. Tags are defined by it's "design" and sometimes presented differently (to the browser) by it's "container organization" [your words]; so yes, what you said is true.

Secondly, "Are there some tags that inherit or is it just what's next to it?" -- Tags that are on the same level are brothers and sisters, or siblings of each other. That's the actual term.

<p> ... Whatever ... </p>
<div> ... whatever ... </div>


Those two tag elements are Siblings to each other. Neither is going to inherit any attributes of the other. They are different tags that DO NOT affect each other.

--------------------------------------------------------
But wait...
--------------------------------------------------------

<div> <p> ... whatever ... </p> </div>

Here the P tag is inside the DIV tag. The P Tag is the Child of the DIV Tag. The DIV Tag is the Parent of the P Tag. These are the actual terms.

And HERE ... YES, the P tag can inherit attributes of the div tag (when it is coded in.)

These are really good questions. Thanks for bringing them up!
;)