PDA

View Full Version : When I change the CSS on one page it changes on all the others too?


PasteyC
05-27-2011, 06:45 PM
Im currently building a website off of a free template i downloaded. Ive copied my index page and renamed it to the certain links incorporated into the page.

When I change the text format on one page it does the same to all the other pages.

Could someone please help me fix this problem!!!

Thanks so much,
Cam

DWcourse
05-28-2011, 05:30 AM
I assume the original page references an external CSS file and so all the rest reference it too. Any changes to the external CSS will affect all pages linked to it. That's the way CSS is supposed to work. If you want to only change a style on one page there are a couple of methods.

Create the new style in the page and make sure it appears after the link to the external CSS file.

Add an ID to the body tag such as <body id="custom"> and place the #custom selector in front of the selector for the rule you want to change. For instance if you had a rule p that affected all paragraphs throughout your site you could overwrite it only for the "custom" page with the rule, #custom p