Advertisement:

Author Topic: Different colours for quotes in a quote  (Read 21913 times)

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Different colours for quotes in a quote
« on: October 27, 2004, 02:35:47 PM »
If would be great, if the quotes background within a quote will get different colours. So you can easier differ quotes within quotes.

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Different colours for quotes in a quote
« Reply #1 on: October 27, 2004, 03:17:47 PM »
you can do that with CSS.
http://css.maxdesign.com.au/selectutorial/selectors_descendant.htm

Code: [Select]
.quote div div
{
/* Style here... */
}

I think that's correct, if not, it's pretty close. :P
Cristián Lávaque http://cristianlavaque.com

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Different colours for quotes in a quote
« Reply #2 on: October 27, 2004, 03:19:59 PM »
.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]

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Re: Different colours for quotes in a quote
« Reply #3 on: October 27, 2004, 03:29:43 PM »
okay thanks, but why don't you use alternate colours for SMF Forum like purple and grey. this would looks good

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Different colours for quotes in a quote
« Reply #4 on: October 27, 2004, 04:11:26 PM »
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...

* Anguz goes find out...
Cristián Lávaque http://cristianlavaque.com

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Different colours for quotes in a quote
« Reply #5 on: October 27, 2004, 07:43:06 PM »
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:

Code: [Select]
.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;
}
Cristián Lávaque http://cristianlavaque.com

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Different colours for quotes in a quote
« Reply #6 on: October 27, 2004, 07:56:16 PM »
Code: [Select]
.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 :)
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Different colours for quotes in a quote
« Reply #7 on: October 27, 2004, 08:12:28 PM »
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.
Cristián Lávaque http://cristianlavaque.com

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Different colours for quotes in a quote
« Reply #8 on: February 19, 2006, 02:17:22 AM »
man, I need to look at the tips and tricks more often. I've been looking for this for ages!

Offline B Patterson

  • Full Member
  • ***
  • Posts: 512
  • Gender: Male
  • Never Miss an Opportunity to be Great
Re: Different colours for quotes in a quote
« Reply #9 on: March 20, 2006, 07:10:17 PM »
Code: [Select]
.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!!
Code: [Select]
.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

Offline 6Scylla

  • Semi-Newbie
  • *
  • Posts: 35
Re: Different colours for quotes in a quote
« Reply #10 on: June 07, 2012, 07:11:01 AM »
I'm really loving the smf main site, so many awesome tricks here. Thanks for another one!