@MOHAMMED-ABD-RAZAQ
Posted
great work bro .
@OctaviOOkumu
Posted
@MOHAMMED-ABD-RAZAQ Thanks
Looking to hire developers?
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.
@MOHAMMED-ABD-RAZAQ
Posted
great work bro .
@OctaviOOkumu
Posted
@MOHAMMED-ABD-RAZAQ Thanks
@mattstuddert
Posted
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!
@mattstuddert
Posted
@OctaviOOkumu ah OK, yeah you can't access them using JS. They're more for presentational uses in your CSS.
@OctaviOOkumu
Posted
@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
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