It makes it possible to re-use the outer selector in more complex ways, like adding a pseudo-class or adding a selector before the parent. So to select a child element with a great-cousin with the class .clicked , the syntax would look something like this: All I see is the actual radio button or checkbox. The .class selector selects elements with a specific class attribute. In my current job, we are in the process of selecting a new CMS to replace our home-grown and aging (8-9yrs) CMS. img[src][alt] Here it is compiled:.grand-child.parent.child.sibling {} What the & isn’t Coyier and a team of swell people. A child selector has the following syntax: Aside from :has, jQuery also has .parent(); Both have their good and bad times. It is an interesting topic to talk about though, and some fresh talk has surfaced. *May or may not contain any actual "CSS" } So few words and so much said. 2. A type selector is sometimes referred to as a tag name selector or element selector, because it selects an HTML tag/element in your document. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors Anyway, seeing your examples made me confuse. For an external resource, I recommend bookmarking the w3schools.com CSS Selector Reference.But for your day-to-day use of CSS selectors in GTM, this guide will hopefully prove useful.

. You can also specify that only specific HTML elements should be affected by a class. Because in every other css selector, it's the last element that describes what's getting styled. A better way would be express it would be" "parent-selector that-has descendant-selector", where as you replace the "that-has" with "<". You can have more than one descendant in the list. img:parent would select all the ancestors. But hey, if you Chris CSS guru can come up with some scenario where parent selectors are making things so much easier. I resorted to a JavaScript solution, which allowed me to target the parent elements at will. Mmm… my english is not so good, but I agree with Ivan : the example and the explanation don’t match with the topic of the article (you made a typo probably). (Aside: this would be a weird departure from the typical syntax where the actual elements being selected are on the right, this would be on the left). I really don’t mind not having it.. but as I said.. may come in hand.. great li < a:hover, li elements with class="intro" element,element: div, p: Selects all
elements and all

elements: element element: div p: Selects all

elements inside

elements: element>element: div > p: Selects all

elements where the parent is … div > p. Selects all

elements where the parent is a

element. This is a great idea! img:nth-parent(1):filter(figure) would select the parent only it it is a figure element. img < a vs. a img, which is an image inside of an a, I want img < a, an a wrapping an image. The Selector is created using a greater-than sign (>) between the parent and child selector. } With that added to our head section of the html page. leverage Jetpack for extra functionality and Local element1 ~ element2. // SCSS.parent { &.skin { background: pink; } } Even if it were doable, div img is simply awful. Will it be like this: /* matches an if an exists as a direct child. Anybody desiring to support their own custom parent combinator in valid CSS syntax should support something like /--parent/ or whatever name makes sense to you, so that you could write a selector like li /--parent/ ul {} and it would target the