How do I style only the text inside lists
How do I style only the text inside lists, I'm using marker on these lists not "::before". And I don't want the marker to be affected at all by it.
22 Replies
Please read #How To Ask Good Questions. We'll need to see your code (codepen preferred, no screenshots please!) to be able to do more than guess.
Why would you need code for that, I'd like to style the "text" part without affecting the ::marker. That's it.
The css would be example lets say I want to apply this style for instance to paragraphs, but also list text without affecting the marker part.
Question marks added, to show where I'd like to apply this possible change to list text
What styles are you trying to add only to the list items is what I'm trying to ask
Oh ok
font-feature-settings:
You can apply some basic CSS to the
::marker
pseudo-element so if it's something that can be added we can work with it
Basically the same as above and the html example above is from dev tools output.
Hmm…I'll be honest I've not worked with
font-feature-settings
before, but according to MDN you can apply them (or override them) via CSS for the ::marker
pseudo-elementYeah the
::marker
should not be affected only the textTry this:
That should remove any FFS (hehehe) added to the
::marker
And yeah is still little support for "font-feature-settings", else I would do it directly to the
@font-face
, but that's only supported in firefox 😦
Hmmm good point indeed I'm forgetting the cascade xDEmbrace the cascade!
He he so true
But nope it's not working, specificity issues or what hmmm
My bad
it works had a typo!
WOO!
Thanks a lot!
YIIISSSSS
🎊
🥳
Can you share a screenshot of what it looks like? I'm intrigued by the font feature settings
And curious as to what you're working on
Yeah embrace the cascade it is!
Oh sure I'm just messing around with it tho, nothing serious just playing around with variable fonts. Learning...
Else my capital I's would be different from my p tags. Which I don't want
Oh, that is cool!
That's the Inter font btw https://rsms.me/inter/
rsms.me/inter
Inter font family
Inter is a typeface family optimized for user interfaces and computer screens