Title: Custom CSS classes not working?
Last modified: August 19, 2016

---

# Custom CSS classes not working?

 *  Resolved [hoov](https://wordpress.org/support/users/hoov/)
 * (@hoov)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/)
 * Is there any reason why my custom CSS tags wouldn’t be working? I’m modifying
   style.css for the correct theme.
 * If I use one of the built in classes (.errorMessage for example) I can use it
   fine in the HTML.
 * But if I create my own it doesn’t work. I created a class called bold in the 
   stylesheet as follows:
    `.bold {font-weight: bold;}`
 * And the HTML looks like so:
    `<span class="bold">test</span>`
 * That doesn’t work and I can’t understand why. I tried div class, and I also tried
   making the class into an ID; that didn’t work either.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281648)
 * Does it suddenly work if you change the CSS to..
 *     ```
       .bold {font-weight: bold!important;}
       ```
   
 * If the answer to the above is yes, then the reasoning is due to the inheritance
   of other styling in the styelsheet already..
 * Firebug in firefox is a good way to see CSS inheritance for elements.
 *  Thread Starter [hoov](https://wordpress.org/support/users/hoov/)
 * (@hoov)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281682)
 * Unfortunately no that didn’t work. I did download Firebug and I see what you 
   mean about the CSS inheritance. That will definitely come in handy.
 * Still trying to figure out why this isn’t working though. Inline styles work 
   fine of course.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281696)
 * A link to your site might help.
 *  Thread Starter [hoov](https://wordpress.org/support/users/hoov/)
 * (@hoov)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281756)
 * [http://identspecialists.com/blog/search/](http://identspecialists.com/blog/search/)
 * Password is _test_. Trying to apply the styles to the word test on that page.
 * Firebug shows the div class wrapping the word. And I see in body where font-weight
   is set but even if I turn that tag off my style doesn’t apply. I’m trying it 
   with the !important tag t31os_ mentioned above.
 *  Thread Starter [hoov](https://wordpress.org/support/users/hoov/)
 * (@hoov)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281757)
 * I gave up and installed the Persistent Styles plug-in which is working. So all
   is well now. I would still be interested in knowing why my CSS wasn’t working
   though.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281758)
 * your css.php causes a ‘parsing error’ and that stops the style ‘.bold’ from being
   applied.
    error code:
 *     ```
       <br />
       <b>Warning</b>:  parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in <b>/home/content/i/d/e/ident20/html/blog/wp-content/themes/blend/css.php</b> on line <b>54</b><br />
       ```
   
 *  Thread Starter [hoov](https://wordpress.org/support/users/hoov/)
 * (@hoov)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281767)
 * Hmm, thank you. Where did you see that message?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281771)
 * in firefox, with the developer add-on (not firebug – although you might be able
   to use that as well). if you click ‘css’ -> ‘edit css’ ; that opens a few lines
   at the bottom of the screen. then click on ‘css.php’ if it is not already open.
 * or you click ‘css’ -> ‘view css’ which opens a new tab with the css files
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281777)
 * Spot on alchymyth, can confirm same error here (also use web developer addon)..
 * Easy to replicate, visit here.
    identspecialists.com/blog/wp-content/themes/blend/
   css.php?c=print.css or identspecialists.com/blog/wp-content/themes/blend/css.
   php?c=style.css&f=sky

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Custom CSS classes not working?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/custom-css-classes-not-working/#post-1281777)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
