I have created a new article record type and as I want to exclude the system default fields from the community page I wanted to edit the CSS code for one page variation only and assign that page based on the article record type.

After looking through various forums everyone seems to say create a custom lightning component but I am not sure how to do this and what code I would need to use.

I need to display this data with section titles but if I add CSS code it will change for every page variation.

enter image description here

Please advise if there is any other way? Thank You, Lorr

1 Answer 1


Hi @lorr81 I know my answer is 1 year 11 months late, but today I figured this out! See the <body></body> tag of your HTML after your page loads, it should have some class names. One of the class names it has will be unique for the current page you're on. You can use that class name to scope your CSS.

For example, if you want the CSS to only show on that specific page, you can change your CSS from:

p {
   color: blue;

to something like this:

.your-page-class-name p {
   color: blue;

I hope that helps!

  • If my page name is 'home' . what would be the code be?
    – APARNA
    Commented Apr 25 at 9:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .