Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 10-07-2011, 03:12 PM Page Specific CSS
Extreme Talker

Posts: 246
Trades: 0
Ok, this is going to seem odd but I have a need for the following scenario:

You have 2 pages, let's assume that they both have a control on the page call txtTextBox. Let's also assume that they need different styling and that you must do the CSS based on the ID.

For Page 1
#txtTextBox
{
color: red;
}

For Page 2
#txtTextBox
{
color: green;
}

Is there syntax that can be used to say that one refers to page 1 and the other refers to page 2, I don't know, something like this:

%Page1.html #txtTextBox
{
color: red;
}

%Page2.html #txtTextBox
{
color: green;
}

This was one will style page 1 the way I want while the other will style page 2 the way I want.

I know I can do the following to make them distinct, but this is not possible for what I want:

#txtTextbox.class1
{
color: red;
}

#txtTextBox.class2
{
color: green;
}

There is a very good reason as to why I want to do it this way so please just respond as to whether there is a way to do this or not.

Thanks in advance.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-07-2011, 03:37 PM Re: Page Specific CSS
Average Talker

Posts: 17
Trades: 0
No, there is no such thing in CSS. There are a number of @ options, but that is not one of them. Can't you style it in a page style block or inline?
__________________
Frank

Please report back how suggestions worked out.

Last edited by FrankknarF; 10-07-2011 at 03:42 PM..
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 10-07-2011, 04:10 PM Re: Page Specific CSS
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Or use two seperate CSS documents, aside from your regular CSS documents you use.
Or just one seperate document that overwrites thet particular id, that is only included on one of the pages.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 10-07-2011, 06:14 PM Re: Page Specific CSS
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If you need it in one document just put it in a style element on the page, so it overrides the external style rules.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-11-2011, 09:18 AM Re: Page Specific CSS
Extreme Talker

Posts: 246
Trades: 0
Thanks, FrankknarF

Everyone else, as I mentioned, I just needed a yes or a no.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Page Specific CSS
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66600 seconds with 12 queries