The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> what does this line of code mean / do?
CharliePrince
post Nov 12 2020, 08:22 PM
Post #1


Novice
**

Group: Members
Posts: 24
Joined: 7-November 20
From: Saint Louis, MO
Member No.: 27,623



I'm reading from this web site (here) . . and do not understand what the > div does?

Can anyone explain what this > gt char does when used like this?

CODE
.flex-container > div {
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 12 2020, 08:35 PM
Post #2


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

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



It's called a child selector. Your specific one matches a P that is the child of an element with the class flex-container.
http://www.w3.org/TR/2011/REC-CSS2-2011060...child-selectors

Note that child means a direct, first level, descendant. Not just any descendant. There's another selector for that, called a descendant selector.

CODE
.foo > p { color: red }


HTML
<div class="foo">
<p>
This text will be red.</p>
</div>

<div class="foo">
<div>
<p>
This text will not.</p>
</div>
</div>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharliePrince
post Nov 12 2020, 09:21 PM
Post #3


Novice
**

Group: Members
Posts: 24
Joined: 7-November 20
From: Saint Louis, MO
Member No.: 27,623




That helps a bunch. Thanks again pandy!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 12 2020, 09:30 PM
Post #4


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

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



You are welcome. smile.gif
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: 15th April 2024 - 11:13 PM