hi i designed html css website, now all is well but i need to have diffrent content and design on every page. As it stands i have css code doing the same design layouts on all pages, which i can't change as the home page will change. Anyway is it poss that i can change the contant of every page using css code or html? What the way plz. Thanks a lot

  • Sure it is possible, but could you post a staging link so that we can see what you've done so far? How to proceed depends on how you have set things up. Abinadi Ayerdis almost 10 years ago
  • Maybe you get your answer faster if you use "search"! ;) Marcel almost 10 years ago

3 answers


I tend to lean heavily on the cascade when writing my CSS. I will write a base stylesheet that covers the common rules that are true in most parts of the site. Then I will append sets of rules that will override the base in certain contexts. Assigning a class to the body tag will allow you to easily shift the appearance of common elements in different parts of the site. You might have several sections to the site like home, articles, gallery, about, and contact. If you apply a corresponding class to the body tag for pages in those sections you won't have to do a lot of custom mark-up to differentiate elements on those pages.

h1 {
color: #121212;
font-family: "helvetica neue", sans-serif;
font-size: 200%;
font-weight: normal;
.about h1 {
color: #f30;
.contact h1 {
color: #f0d;

The first rule says that an h1 should behave a specific way.

The second rule overrides the color for an h1 that is a child of the "about" class.

The third rule overrides the color for an h1 that is a child of the "contact" class.

This way you can have plain old h1 tags on each page but it can be rendered differently depending on context. This technique can be applied with a pretty high degree of detail, just pay attention to specificity. The technique does assume that you have the ability to affect the HTML to apply the classes to the body tags at will.

Answered almost 10 years ago by Alex Taylor

Confusing...I think your talking about your using an external style sheet and you need to have different stuff on every page but if u change one then it all changes correct? If this is right, then just use an inline css. It goes in the html

Answered almost 10 years ago by canyonchase1

You can have different "design" (styles) on each page. Just @import a .css that contains style information you want for just that page.

However, you can not store raw content data in a CSS file (as far as I know) to have each page pull. That's what databases are for!

Answered almost 10 years ago by elitesouth