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
css conditional upon another css?
Old 03-08-2007, 03:02 AM css conditional upon another css?
Average Talker

Posts: 17
Location: Athens Greece
Trades: 0
Basically, I want to have a different quote style for
.windowbg
.windowbg2

(You can see the quote at work here: http://www.translatum.gr/forum/index...ic,8179.0.html)

I use the one below as a quote style but what i want is to be able to define a different image depending on the alternating window style (so that the upper left corner of the image matches that of the background). I did try with transparency but it showed the quote style background colour instead.

Code:
.quote {
    display: block;
    font-style: italic;
    background: #9bb3d0 url( "http://www.translatum.gr/forum/Themes/babylon/images/quote_corner.png" ) 0 0 no-repeat;
    color: #000;
    padding: 10px;
    padding-left: 50px;
    margin:  15px 0;
}
Code:
/* Alternating backgrounds for posts, and several other sections of the forum. */

.windowbg
{   color: #000000;
   background-color: #E1E1E1;
}
.windowbg2
{
   color: #000000;
   background-color: #F0F0F0;
}
__________________
Spiros Doikas

Please login or register to view this content. Registration is FREE
translatum.gr is offline
Reply With Quote
View Public Profile Visit translatum.gr's homepage!
 
 
Register now for full access!
Old 03-08-2007, 03:21 AM Re: css conditional upon another css?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use descendants

Code:
element.windowbg .quote {
/*the properties that need to be different for this quote style go in here */
}
element.windowbg2 .quote {
/*the properties that need to be different for quote style 2 go in here */
}
__________________
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 03-08-2007, 04:03 AM Re: css conditional upon another css?
Average Talker

Posts: 17
Location: Athens Greece
Trades: 0
Yep, tried it, but did not work, perhaps I am missing something:

Full css: http://www.nonsmokersclub.com/forum/...ault/style.css
Test URL: http://www.nonsmokersclub.com/forum/...04.html#msg104


.windowbg
{
color: #000000;
background-color: #ECEDF3;
}

element.windowbg .quote {
color: #000000;
background-color: #D7DAEC;
border: 1px solid #000000;
margin: 1px;
padding: 1px;
font-size: x-small;
line-height: 1.4em;
}

.windowbg2
{
color: #000000;
background-color: #F6F6F6;
}

element.windowbg2 .quote {
color: #aeeffa;
background-color: #aaeffC;
border: 5px solid #0e0ff0;
margin: 5px;
padding: 5px;
font-size: small;
line-height: 2.4em;
}
__________________
Spiros Doikas

Please login or register to view this content. Registration is FREE
translatum.gr is offline
Reply With Quote
View Public Profile Visit translatum.gr's homepage!
 
Old 03-08-2007, 04:11 AM Re: css conditional upon another css?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You do need to replace [element] with the appropriate container element type.

ie:
div.window
p.window
td.window
__________________
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 03-08-2007, 05:07 AM Re: css conditional upon another css?
Average Talker

Posts: 17
Location: Athens Greece
Trades: 0
Edit: Indeed, it works!

Thank you for you reply and pardon my ignorance

In the html I can see

Code:
<td class="windowbg" valign="middle"><img src="http://www.nonsmokersclub.com/forum/index.php?action=dlattach;attach=3;type=avatar" alt="" class="avatar" border="0" /></td>
So that means I should do this:?

td.windowbg .quote
__________________
Spiros Doikas

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

Last edited by translatum.gr; 03-08-2007 at 05:27 AM..
translatum.gr is offline
Reply With Quote
View Public Profile Visit translatum.gr's homepage!
 
Reply     « Reply to css conditional upon another 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 1.78445 seconds with 12 queries