Forum Moderators: not2easy
Set a class or id on your body, indicating the section the page is part of.
Use that identifyer to style things differently)
e.g.:
a page news.html and a page aboutus.html, the news should have a yellow background with red titles and the aboutus should have a blue background with white letters.
news.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body id="news">
<h1>NEWS</h1>
<p>Hello world</p>
</body>
</html>
aboutus.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body id="about">
<h1>ABOUT US</h1>
<p>Hello world</p>
</body>
</html>
style.css:
* {
margin:0;
padding:0;
}
#news h1 {
color: red;
}
#news {
background-color: yellow;
}
#about
background-color: blue;
color: white;
}
code itself is untested, but I use something very similar in production use