Easy way to add custom CSS to certain text in Wordpress

JimHalpert

Supreme Member
Joined
Jan 16, 2016
Messages
1,345
Reaction score
292
Was wondering if there is an easy way to add custom CSS to certain text in Wordpress.

The text would differ but I want to add a box around them for all of them.

So far what I have found is to use the Text editor view in wordpress to define a class.

<span class="style-pc">Text here</span>

And then use CSS to alter that class. But given that I have over 20 of such boxes in one post, manually doing this is getting tiring and error-prone. Is there an easy way to mark text as a certain class?

Thanks.
 
you know css? if you do then use inspect element to identify the thing you want to edit, then use wordpress custom css from the Customize menu to put your new css code.. if your theme uses any sort of visual builder then you can edit the css on the page/post itself.. and almost always you can edit css by going through your theme options panel.

PS: you can always edit the original css files ;)
PS2: if you need help, PM me what you want to do and i will send you the code for it and tell you where to paste it.
 
Look for: TinyMCE Custom Styles


You can add custom css code then high light the text in the editor then pick the shortcut you created in the text editor menu. A bit easier if you need the same style 100s of times without using code view.
 
Is it the same words every time?

No it is a different type of word. I need to specify them each time. For example, sometimes it would be Buy Now. Other times it would be Limited Time Only!

ask these types of questions on stackoverflow

Thanks would try my luck there. Which forums in particular? The wordpress forums or the HTML forums?

you know css? if you do then use inspect element to identify the thing you want to edit, then use wordpress custom css from the Customize menu to put your new css code.. if your theme uses any sort of visual builder then you can edit the css on the page/post itself.. and almost always you can edit css by going through your theme options panel.

PS: you can always edit the original css files ;)
PS2: if you need help, PM me what you want to do and i will send you the code for it and tell you where to paste it.

Thanks for the offer! Would have a look myself first.

Look for: TinyMCE Custom Styles


You can add custom css code then high light the text in the editor then pick the shortcut you created in the text editor menu. A bit easier if you need the same style 100s of times without using code view.

This looks exactly like what I need. Thank you.
 
Look up the yellow pencil plugin for WordPress. It's very easy to use and you can edit every thing u want.
 
well that depends if you dont know what you're doing you should contact a programmer for this
 
Back
Top