Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Treehouse Club - MASH MASH - JavaScript Stuff You Can Change

change the colour of the answers only

how can I have it so when people click submit the text is in black but I can change the colour of the answers to stick out more? TIA Cheers!


1 Answer

Steven Parker
Steven Parker
221,324 Points

Since the element that contains the answers has an ID of "answers", and each term that is inserted into the text is inside a span element, you can easily add a new rule to the CSS to change the color (to red in this example):

#answers span { color: red; }

You could also add just the property "color: red;" to the existing rule for "#answers p span" at about line 78.