I would like to change the following sentence “CREATING STYLE FOR BETTER LIFE” to a different font (Rochester) and i have tried several CSS codes so far but none has worked for me so far.

Website: http://www.tarshim.com

Please tell me what CSS code should i use and where to apply it



Include Rochester font from Google

<link href="https://fonts.googleapis.com/css?family=Rochester" rel="stylesheet">

See wp_enqueue_style() or maybe you can use your theme (set font rochester to a heading you dont use for example).

Add a class to that h2:

<h2 class="rochester-font">CREATING STYLE FOR BETTER LIFE</h2>

In your CSS:

.rochester-font {
  font-family: 'Rochester', cursive;
  /* other css */

Don't forget the browser caching! Use hard-refresh when you're testing CSS.

Regards, Bjorn

  • h2 is already being used for this line as well as another line and i only want to change the font of this one – Mike Jun 12 '18 at 6:19
  • I know, that's why i mention you have to add a Class to that specific <h2>. You can add that class to any <h2> that needs the Rochester font-family. Please follow my steps exactly and it will work. – Bjorn Jun 12 '18 at 6:32
  • I changed the CSS in my answer. Now you can use it for all <element> in your site. – Bjorn Jun 12 '18 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.