Grow your CSS skills. Land your dream job.

Design changes (CSS) only on some pages of my website?

  • # March 31, 2013 at 9:56 am

    How can I make changes with CSS, only on some pages of my website? **For example:** I want to make my navigation menu smaller, but only on my main page (index.html).

    I can edit ONLY the main .css file

    # March 31, 2013 at 10:15 am

    Add extra class, specific one for the main page only, and you can set the css properties for it.

    # March 31, 2013 at 10:33 am

    Are you able to edit HTML?

    You could add a class to body element depending on what page you are on. So for your home page add ``, and for each other page add appropriate class. Then in your CSS you can target each page individually.

    .home .menu {}
    .home .menu ul li {} //etc
    .about .menu {}
    .about .menu ul li {} //etc

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".