Title: Restricting CSS
Last modified: August 30, 2016

---

# Restricting CSS

 *  Resolved [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/restricting-css/)
 * How do I restrict custom CSS to a particular part? Pages or a custom post type
   for example?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/restricting-css/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/restricting-css/page/2/?output_format=md)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725322)
 * Hi there!
 * Have you looked into using a plugin:
    [https://wordpress.org/plugins/search.php?q=custom+css](https://wordpress.org/plugins/search.php?q=custom+css)
 * There are quite a few that you can look into. I haven’t personally used those
   only because I don’t modify CSS much for posts/pages.
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725325)
 * Castaneda,
 * The only plugins I have found for CSS only restrict CSS to the site as a whole,
   or to a particular post or page. I’m talking about restricting CSS to a particular
   template.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725326)
 * CSS itself can target specific areas of a page and specific pages, as long as
   there is some unique HTML to that area and page. Themes that are distributed 
   on WordPress.org have a unique class in the `<body>` element, something like ‘
   page-id-56’, that you can use in CSS.
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725327)
 * Andrew,
 * I’ll check it out. Thank you.
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725331)
 * Andrew,
 * Where would I find the <body> element in 2014>
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725333)
 * Are there any templates in 2013, 2014, or 2015 with the <body> element?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725334)
 * Yes every single theme distributed on WordPress.org has the `<body>` element.
   For CSS, you only need to look at the generated code on your website and not 
   look into the PHP files themselves.
    The generated code can be seen when you 
   right click on a page and select the ‘View source’ option.
 * Some browsers, or some addons in browsers, let you see that code in a much neater
   way. Have you tried the Firebug addon for Firefox?
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725335)
 * That’s where they hide it. 🙂
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725336)
 * Andrew,
 * Your suggestion didn’t work. So I’m going to try “page, p”
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725337)
 * And it worked. And there was much rejoicing.
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725339)
 * But not the way I thought. You can find an example at [](http://mythusmage.today/mythus/index.php/dangerous-journeys/introduction/).
   Be sure to check out the source code.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725341)
 * Not sure what you mean, I see the the unique class of ‘page-id-232’ on that page:
 *     ```
       <body class="page page-id-232 page-child parent-pageid-230 page-template-default styles header-image footer-widgets singular">
       ```
   
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725342)
 * But then I deleted the “p” and the columns disappeared.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725343)
 * What columns are you referring to?
 *  Thread Starter [mythusmage](https://wordpress.org/support/users/mythusmage/)
 * (@mythusmage)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/#post-6725344)
 * Andrew,
 * Not a particular page, pages in general.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/restricting-css/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/restricting-css/page/2/?output_format=md)

The topic ‘Restricting CSS’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [post-type](https://wordpress.org/support/topic-tag/post-type/)
 * [restricting](https://wordpress.org/support/topic-tag/restricting/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 3 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/restricting-css/page/2/#post-6725345)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
