what does this line of code mean / do? |
what does this line of code mean / do? |
CharliePrince |
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 { |
pandy |
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> |
CharliePrince |
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! |
pandy |
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.
|
Lo-Fi Version | Time is now: 19th April 2024 - 02:42 PM |