Not included in your plan? Want to learn more about the benefits? Leave us a message! If you're viewing this on our Help Center, click the Support bubble in the lower-right of this page.
Every page on your UserVoice site adds classes to its <body> tag. Use them in your custom CSS to style specific pages, forums or visitors differently. For example, idea pages add uv-suggestion-page, so you can style the sidebar on idea pages only.
Note: Custom design is self-service. As we improve UserVoice, custom code may need adjusting, and keeping it up to date is your responsibility. New to custom design? Start with Custom HTML, CSS and JavaScript.
How Body Classes Work
Here's the <body> tag on a forum page:
<body class="uv-primaryColor-dark uv-locale-en uv-direction-ltr uv-forum uv-forum-1 uv-no-user uv-forum-page">
This tells us the primary color is dark, the locale is English, text reads left to right, the page belongs to forum 1, no one is signed in, and it's a forum page.
Find a Forum or Category ID
Open the forum and check its address. In /forums/123456-feedback, the forum ID is 123456, so its class is uv-forum-123456. Category IDs work the same way: filter the forum by a category and find the number after /category/ in the address.
Global Attributes
These classes are on every page.
| Class name | Description |
|---|---|
uv-primaryColor-[light|dark] |
Whether the site's primary color is light or dark |
uv-locale-[locale] |
The page's current locale, for example uv-locale-de
|
uv-direction-[direction] |
The text direction of the current language (rtl or ltr) |
Session Attributes
These classes change based on who's viewing the page. A page can have more than one.
| Class name | Description |
|---|---|
uv-no-user |
No one is signed in |
uv-user |
A user is signed in |
uv-user-admin |
The signed-in user is an admin of this site |
Page Types
Each page has exactly one page type.
| Class name | Description |
|---|---|
uv-home-page |
Home page |
uv-helpdesk-page |
Helpdesk index |
uv-forum-page |
Forum pages |
uv-suggestion-page |
Idea pages |
uv-topic-page |
Helpdesk topic pages |
uv-article-page |
Helpdesk article pages |
uv-profile-page |
User profile pages |
uv-tos-page |
Terms of Service page |
uv-signin-page |
Sign-in page |
uv-password-page |
Reset password page |
Page Attributes
These classes describe the section and record a page belongs to. A page can have several, for example uv-forum uv-forum-123 uv-forum-private.
| Class name | Description |
|---|---|
uv-helpdesk |
Page is part of the helpdesk |
uv-forum |
Page is part of a forum |
uv-forum-[forum_id] |
The current forum's ID |
uv-forum-private |
Page is part of a private forum |
uv-forum-access-denied |
The user doesn't have access to this private forum |
uv-category-[category_id] |
The category's ID, if the page is in a forum category |
uv-topic-[topic_id] |
The current helpdesk topic's ID |
Good to Know
What Custom CSS Can and Can't Do
Custom CSS changes how your portal looks. It can:
- Change colors, fonts, spacing and layout.
- Hide or show parts of a page on specific pages, in specific forums, or for signed-in or signed-out visitors.
- Add short visual text, like a label or a note.
It can't change how your portal works. It can't:
- Control who can see a forum or idea. Use private forums and access settings for that.
- Remove content from the page. Hidden content is still in the page's code.
- Change emails, notifications or the Admin Console.
What Still Happens With Custom CSS
Even when something is hidden on screen:
- Hidden forums and ideas can still be opened by anyone with the link.
- Hidden names and comments still exist. They appear in the page's code, on profile pages, in email notifications and in the Admin Console.
- Public content can still appear in search engines.
- Hiding a section hides everything in it. Hiding the sidebar also hides search and the idea box.
- Updates can affect your styles. As we improve UserVoice, recheck your portal after changes and adjust your CSS if needed.
Before going live, test your changes in an incognito or private browser window, or signed in as a regular user, not just as an admin. Not sure whether something is possible? Our support team is happy to point you in the right direction.