Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 8, 2019 08:45 pm GMT

A Little Reminder That Pseudo Elements are Children, Kinda.

Here's a container with some child elements:

<div class="container">  <div>item</div>  <div>item</div>  <div>item</div></div>

If I do:

.container::before {  content: "x"}

I'm essentially doing:

<div class="container">  [[[ ::before psuedo-element here ]]]  <div>item</div>  <div>item</div>  <div>item</div></div>

Which will behave just like a child element mostly. One tricky thing is that no selector selects it other than the one you used to create it (or a similar selector that is literally a ::before or ::after that ends up in the same … Read article

The post A Little Reminder That Pseudo Elements are Children, Kinda. appeared first on CSS-Tricks.


Original Link: https://css-tricks.com/a-little-reminder-that-pseudo-elements-are-children-kinda/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks