# CSS class on Body tag to distinguish homepage / non-category page

**URL:** <https://meta.discourse.org/t/css-class-on-body-tag-to-distinguish-homepage-non-category-page/51201>\
**Category:** Feature\
**Created:** [2016 年10 月 7 日 00:15 UTC](https://meta.discourse.org/t/css-class-on-body-tag-to-distinguish-homepage-non-category-page/51201 "2016-10-07T00:15:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)\
发布日期： [2016 年10 月 7 日 00:15 UTC](https://meta.discourse.org/t/css-class-on-body-tag-to-distinguish-homepage-non-category-page/51201/1 "2016-10-07T00:15:01Z")

</div>

I had mentioned this in another topic, but thought I’d be more direct 😊

Could a class be added to the body tag of the homepage (and perhaps to all non-category pages)? I couldnt figure out how to target CSS only to be applied to the homepage or non category pages

ie BODY class=latesthome global

(If no category identified, the global class gets added)

Its particularly useful for backgrounds. Categories of course have the baked in background feature, but to apply backgrounds for other screens, we depend on css. It also means for inner pages, we are loading our global background unnecessarily.

Perhaps there’s already some way of achieving what I’m describing, in a cleaner way?

---

_[View the full topic](https://meta.discourse.org/t/css-class-on-body-tag-to-distinguish-homepage-non-category-page/51201)._
