I have this class:
.word-dealer-heading
and this is the text in the h2
Major Manufacturing Parts Industry
I want to apply separate style especially font-family in the CSS for the each above word.
The class name is already given
I can only apply in the CSS not add any HTML.
2
Answers
You can’t target specific words within css but what you could do if you have access to the content is use ::before and ::after pseudo elements to create this effect
For example if you wanted to change the word ‘Manufacturing to be a different font you could do this
and then for styling
Is this crazy? Sure.
But it does fulfill your requirement of only touching CSS 🙂
visibility: hidden
)::before
or::after
elements to load the SVG ascontent
in your css