NameSilo

Different css style based on another css style?

Spaceship Spaceship
Watch

spiros

New Member
Impact
0
I want to have a different quote style for:
.windowbg
.windowbg2

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.

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

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;
}
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Not sure exactly what you mean here... but I think you want two different colored quote boxes?

Youve got the code already, so whats the problem?

Your code would be something like this

<div class="quote windowbg">
QUOTE 1 GOES HERE
</div>

<div class="quote windowbg2">
QUOTE 2 GOES HERE
</div>

and your css would be exactly how you have it now except youll remove the background from the .quote line, and instead add it to:
.windowbg { background: #9bb3d0 url( "IMAGE_COLOR_1.png" ) 0 0 no-repeat; }
.windowbg2 { background: #9bb3d0 url( "IMAGE_COLOR_2.png" ) 0 0 no-repeat; }

Hope this helps
 
0
•••
found it

I found the solution and it was very simple:

Code:
td.windowbg .quote {

    display: block;
    font-style: italic;
    background: #9bb3d0 url( "http://www.translatum.gr/forum/Themes/babylon/images/quote_corner-a.png" ) 0 0 no-repeat;
    color: #000;
    padding: 10px;
    padding-left: 50px;
    margin:  15px 0;
}

td.windowbg2 .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;
}
 
0
•••

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back