Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38171

Re: HTML dom "document parent, child notation"

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: HTML dom "document parent, child notation"
Date Tue, 28 Jan 2020 15:25:13 +0100
Lines 55
Message-ID <h9aui9Ft3gqU1@mid.individual.net> (permalink)
References <eab890f6-26af-41ce-b4cc-964fddf3b7a7@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace individual.net hjGo5drgzs/42X9B9IbRmgSfb+Lhnwgm0C0+qMXwT1M+j7Vrcn
Cancel-Lock sha1:7oceVwSQsgAl3XDKFUbLtHja/2Y=
In-Reply-To <eab890f6-26af-41ce-b4cc-964fddf3b7a7@googlegroups.com>
Content-Language en-US
Xref csiph.com comp.lang.javascript:38171

Show key headers only | View raw


On 28.01.20 08:18, Jonas Thörnvall wrote:

> What is the justification for using the parent child notation between
> documents that is loaded from same source, for example iframes?

Example?

> What is the idea behind it, why is it there?

Because there can be elements which are parents of other elements.

For example:

<ol id="mylist">
  <li>...</li>
  <li>...</li>
  <li>
    <ul>
      <li>...</li>
      <li>...</li>
    </ul>
  </li>
</ol>

So <li> is a child of <ol> but there are also <li> elements which are
children of <ul>.

if you want to define a style for those <li> elements which children of
<ul> but not <ol>, you can define this as following:

ul > li {
}

Or you need a rule which styles only elements which are inside an <ul>
element which is a child of <li> inside <ol>:

ol > li > ul > li {
}

And you can also style all elements which are children of <ol> with tge
ID "mylist", no matter if "direct" children or just somewhere inside the
hierarchy:

ol#mylist li {
}

More about this:

<https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors>



-- 
Arno Welzel
https://arnowelzel.de

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-27 23:18 -0800
  Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-27 23:22 -0800
    Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-27 23:47 -0800
      Re: HTML dom "document parent, child notation" dr.j.r.stockton@gmail.com - 2020-01-28 01:37 -0800
        Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-28 01:59 -0800
    Re: HTML dom "document parent, child notation" JJ <jj4public@vfemail.net> - 2020-01-28 18:43 +0700
      Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-28 03:52 -0800
        Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-28 03:59 -0800
          Re: HTML dom "document parent, child notation" JJ <jj4public@vfemail.net> - 2020-01-29 20:07 +0700
            Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-02-05 08:02 -0800
              Re: HTML dom "document parent, child notation" "R.Wieser" <address@not.available> - 2020-02-06 12:50 +0100
            Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-02-05 08:05 -0800
            Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-02-05 08:06 -0800
  Re: HTML dom "document parent, child notation" "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-01-28 05:17 -0800
    Re: HTML dom "document parent, child notation" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-01-28 17:54 -0800
  Re: HTML dom "document parent, child notation" Arno Welzel <usenet@arnowelzel.de> - 2020-01-28 15:25 +0100

csiph-web