okay I will just post a quick simple tutorial for you

and this will work for both posts and pages.
Requirements:
- Text Editor
- Basic Knowledge of CSS and HTML
- WordPress installed (local server or installed on your own website)
1. Open header.php with your text editor (located in your desired theme's folder, usually in wp-content/themes/your theme/) and look for this line
Code:
<body <?php body_class(); ?>>
Replace that line with this one:
Code:
<body id="page<?=$post->ID?>" <?php body_class(); ?>>
This basically adds a special id for each page/post. example:
page22
which can be used in CSS to style different elements based on <body> id.
2. Open the main CSS file (usually style.css)
now you can edit any element based on specific post/page
here's an example:
Code:
#header {
default properties fall here;
}
/* I want to have a red background color for page id 22 */
#page22 #header {
background-color:red;
}
/* but for post id 12 I want it black */
#page12 #header {
background-color:#000;
}
3. save everything and give it a test
(or upload files to your web host to test)
FAQs
Q: How do I know the pageID of each post/page?
A: I haven't came across any easier way, but you can find out in your post/page edit screen in your WordPress admin panel - pick a post/page and look at the URL
something like: that number is the actual ID of the page/post. or you can view it by checking the page source and is something like
Q: Can I edit other elements beside #header?
A: Yes. you can edit any element or .class or #id. example:
Code:
/* normal paragraph properties */
p {
font-size:10px;
}
/* the paragraphs in post 31 */
#page31 p {
font-size:12px;
color:green;
}
Need further help? Let me know!

Hopefully this information was useful
Regards,
Aziz
Bookmarks