Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-13-2011, 02:25 PM   PM User | #1
FuxiAdmin
New to the CF scene

 
Join Date: Oct 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
FuxiAdmin is an unknown quantity at this point
Body Class in Wordpress?

Hi

Is anybody here familiar with body class in wordpress?

I have different category options on the home page of I site that I am setting up, please view: www.sugartreelondon.com

I would like to make the colour background on each of the 'more stories' bit, different for each category but cannot seem to find a way to target that element.

The line of code used for the background is;
Code:
.more_stories{background:#8f8e3e;margin:0 10px 0 10px;padding:0 0 0 0;border-bottom:1px solid #d7d7d7;font-size:0.9em;font-weight:bold;}
I thought that to target and change this I would need the code;
Code:
body.more_stories cat-item cat-item-3 {background:#fff;}
But this is not working. Can anybody help?

Thanks in advance.
FuxiAdmin is offline   Reply With Quote
Old 11-13-2011, 03:37 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello FuxiAdmin,
I'm not sure why the body tag is involved here.

A better approach might be specifically targeting each ul like this -
Code:
#col1 .more_stories {background: #f00;}
#col2 .more_stories {background: #00f;}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
FuxiAdmin (11-13-2011)
Old 11-13-2011, 07:00 PM   PM User | #3
FuxiAdmin
New to the CF scene

 
Join Date: Oct 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
FuxiAdmin is an unknown quantity at this point
The body class is used in wordpress to change the style of particular elements throughout a site. I am getting the more_stories from the style css and am getting that categories name cat-widget 3 etc, from the source.
FuxiAdmin is offline   Reply With Quote
Old 11-13-2011, 07:47 PM   PM User | #4
FuxiAdmin
New to the CF scene

 
Join Date: Oct 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
FuxiAdmin is an unknown quantity at this point
Exactly ignore my last post, Excavator you were absolutely right, thank you so much.
FuxiAdmin is offline   Reply With Quote
Old 11-13-2011, 08:24 PM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by FuxiAdmin View Post
Exactly ignore my last post, Excavator you were absolutely right, thank you so much.
Cascading, targeting and precedence.

And precedence is always a good study.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Tags
body class, color, different backgrounds, wordpress

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:55 PM.


Advertisement
Log in to turn off these ads.