Mobile first site using Sass, CS Grid, HTML, JavaScript
Design comparison
Solution retrospective
I had a lot of fun with this. Question: Is there any way of changing a pseud-class (e.g "::after") via manipulating its attributes? So far I haven't found any.
Community feedback
- @MOHAMMED-ABD-RAZAQPosted about 5 years ago
great work bro .
0 - @mattstuddertPosted about 5 years ago
Glad you enjoyed this challenge! You can add content to your pseudo-elements via HTML attributes like this:
HTML <div data-text="Hi"></div> CSS div::before { content: attr(data-text); }
Other than that, as soon as you have a
content
property on your pseudo-elements you can style them like any other element.I hope that helps!
0@mattstuddertPosted about 5 years ago@OctaviOOkumu ah OK, yeah you can't access them using JS. They're more for presentational uses in your CSS.
0@OctaviOOkumuPosted about 5 years ago@mattstuddert Thanks a lot. I was thinking more about accessing it using JavaScript,for instance, changing its content. So far I haven't gotten any solution to it, so I used a normal p/div tag instead of a pseudo-element
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord