Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Kathryn Presner

    (@zoonini)

    You can target the homepage by adding .home in front of your CSS declaration.

    Let me know how it goes.

    Thread Starter claus90

    (@claus90)

    I tried that, but it still applies to all pages (for example it still applies to the pricing page columns)

    Moderator Kathryn Presner

    (@zoonini)

    You need a space after .home and before your other selectors.

    For example, to make the menu links purple only on the homepage:

    .home .primary-navigation a {
      color: #bb00bb;
    }

    Having a space means you’re targeting an element further down the HTML structure. (DOM)

    Thread Starter claus90

    (@claus90)

    Thanks, I tried this but it still affects all pages. In my case, I want to add right padding 40px to the columns in the homepage and no padding in the columns in the pricing page. I added home. with space as you suggested but it still affects all pages.

    Moderator Kathryn Presner

    (@zoonini)

    Thanks, I tried this but it still affects all pages. In my case, I want to add right padding 40px to the columns in the homepage and no padding in the columns in the pricing page. I added home. with space as you suggested but it still affects all pages.

    Could you please paste the CSS that isn’t working as you expect here, in a Code block? I’ll be glad to have a look.

    Please also provide a mockup/image clearly showing where exactly you are looking to add padding on the homepage. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘add css for one page only’ is closed to new replies.