Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: klumy in Oktober 27, 2004, 02:35:47 NACHMITTAGS

Titel: Different colours for quotes in a quote
Beitrag von: klumy in Oktober 27, 2004, 02:35:47 NACHMITTAGS
If would be great, if the quotes background within a quote will get different colours. So you can easier differ quotes within quotes.
Titel: Re: Different colours for quotes in a quote
Beitrag von: Anguz in Oktober 27, 2004, 03:17:47 NACHMITTAGS
you can do that with CSS.
http://css.maxdesign.com.au/selectutorial/selectors_descendant.htm


.quote div div
{
/* Style here... */
}


I think that's correct, if not, it's pretty close. :P
Titel: Re: Different colours for quotes in a quote
Beitrag von: [Unknown] in Oktober 27, 2004, 03:19:59 NACHMITTAGS
.quote .quote
{
   background-color: hotpink;
}
.quote .quote .quote
{
   background-color: yellow;
}
.quote .quote .quote .quote
{
   background-color: white;
}
.quote .quote .quote .quote .quote
{
   background-color: red;
}
.quote .quote .quote .quote .quote .quote
{
   background-color: brown;
}

If you wanted it really really ugly, use the above in your css.

-[Unknown]
Titel: Re: Different colours for quotes in a quote
Beitrag von: klumy in Oktober 27, 2004, 03:29:43 NACHMITTAGS
okay thanks, but why don't you use alternate colours for SMF Forum like purple and grey. this would looks good
Titel: Re: Different colours for quotes in a quote
Beitrag von: Anguz in Oktober 27, 2004, 04:11:26 NACHMITTAGS
Thanks [Unknown], I knew it mine wasn't right, but was close. :P

klumy, the backgrounds for topic replies are done with different classes. AFAIK, it can also be done with CSS, just can't remember how. It's following the same method shown here, but used a bit different...

/me goes find out...
Titel: Re: Different colours for quotes in a quote
Beitrag von: Anguz in Oktober 27, 2004, 07:43:06 NACHMITTAGS
I'm sorry, couldn't find it. You can just do it like [Unknown] said and use the two colors you want to use, alternating. Decide up to how many nested quotes you may have and style up to that. You most probably won't need more than what he wrote. Example:


.quote .quote
{
   background-color: grey;
}
.quote .quote .quote
{
   background-color: white;
}
.quote .quote .quote .quote
{
   background-color: grey;
}
.quote .quote .quote .quote .quote
{
   background-color: white;
}
.quote .quote .quote .quote .quote .quote
{
   background-color: grey;
}
Titel: Re: Different colours for quotes in a quote
Beitrag von: Oldiesmann in Oktober 27, 2004, 07:56:16 NACHMITTAGS

.quote .quote, .quote .quote .quote .quote, .quote .quote .quote .quote .quote .quote
{
background-color: grey;
}
.quote .quote .quote, .quote .quote .quote .quote .quote
{
background-color: white;
}


A little bit neater :)
Titel: Re: Different colours for quotes in a quote
Beitrag von: Anguz in Oktober 27, 2004, 08:12:28 NACHMITTAGS
Zitat von: Oldiesmann in Oktober 27, 2004, 07:56:16 NACHMITTAGS
A little bit neater :)

Thanks. :)

It takes less lines, but it's a bit harder to see at what nest level you are though. But it does look neater.
Titel: Re: Different colours for quotes in a quote
Beitrag von: trenchteam in Februar 19, 2006, 02:17:22 VORMITTAG
man, I need to look at the tips and tricks more often. I've been looking for this for ages!
Titel: Re: Different colours for quotes in a quote
Beitrag von: B Patterson in März 20, 2006, 07:10:17 NACHMITTAGS
Zitat von: Oldiesmann in Oktober 27, 2004, 07:56:16 NACHMITTAGS

.quote .quote, .quote .quote .quote .quote, .quote .quote .quote .quote .quote .quote
{
background-color: grey;
}
.quote .quote .quote, .quote .quote .quote .quote .quote
{
background-color: white;
}


A little bit neater :)

Still not complete.... you're missing the first .quote!!
.quote,
.quote .quote .quote,
.quote .quote .quote .quote .quote
{
    background-color: #fff; /* You could use white... I like HEX colors */
}
.quote .quote,
.quote .quote .quote .quote,
.quote .quote .quote .quote .quote .quote
{
    background-color: #ccc; /* You could use gray, but see above comment */
}

And yet still neater!!

The word "quote" looks so wrong after typing so many times....

~Brett
Titel: Re: Different colours for quotes in a quote
Beitrag von: 6Scylla in Juni 07, 2012, 07:11:01 VORMITTAG
I'm really loving the smf main site, so many awesome tricks here. Thanks for another one!