Apply CSS to All Lessons/Topics in the Same Course

Updated 2 years ago
by Dave Warfel

There might come a time when you want to apply some CSS to all lessons/topics/quizzes that are within the same course. Maybe you want to change the background color in focus mode, change the font size of all the lesson/topic titles in a course, etc.

Fortunately, LearnDash adds a class to the <body> tag that indicates a lesson/topic/quiz belongs to a specific course. This same class name is used on all lessons, topics & quizzes within that course. We can use this to write blanket CSS that will apply to every piece of content within a particular course.

You can use the following CSS class before any other CSS selector to apply those styles to all lessons/topics/quizzes of a specific course:

You need to be a premium member to continue accessing this content.

Sign Up Today →

All CSS code should either be placed in a child theme’s main CSS file (typically style.css), or the Additional CSS area of the WordPress Customizer.

How to Add CSS to Your Site

Forum Rules

Be Kind & Patient

We’re here to learn and/or help each other. Please don’t be mean, rude, or condescending. Treat all members the way you should be treating dogs and your elders—with the utmost love & respect.

External Links

✅ Other websites that add value, help solve problems & contribute to the discussion. ❌ Affiliate links are prohibited. (Site owners may use affiliate links to help support the site.)

Promotion

✅ You may promote your own products/services if they are relevant to an existing discussion. You must disclose your relationship with the product(s).
❌ You may not create new posts simply to promote your products.

Non-LearnDash Topics

❌ General (free) Forum: Only LearnDash-specific topics are allowed.
✅ Premium Forums: You are allowed to post other questions tangentially related to LearnDash. Please use the appropriately named forum. If it doesn’t exist, use the “LearnDash Integrations” forum.

Our Right to Remove

We reserve the right to remove any content, at any time, for any reason. We can also merge one post with another. We will exercise caution when removing content and always try to provide an explanation.