Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML Build a Simple Website Styling Content Fonts and Colors

Where the HEX do I put this?

I'm lost. I don't exactly recall where I'm supposed to place the HEX designations.

//Mike

Michael Hinrichs
Michael Hinrichs
10,920 Points

on a color attribute...

div { color: #fafafa; }

6 Answers

Are you working on the Fonts & Colors code challenge? Your color codes will go in the style.css file. For setting font colors, you can just use the color attribute, such as:

color: #000000;

for setting the font to black. You can set the color right after you set the font-family.

Charlie Thomas
Charlie Thomas
40,856 Points

Under the font-family line in style.css type:

font-color: #FAF3BC;
Charlie Thomas
Charlie Thomas
40,856 Points

Under the font-family line in style.css type:

font-color: #FAF3BC;
David Appleby
David Appleby
5,213 Points

If you're talking about using hex codes as colours in CSS, simply replace your colour short code (e.g. Black) with the hex code (e.g. #000000).

So your CSS might look like this: body { background-color: #000000; }

Check out the colour values video in the CSS deep dive for more: http://teamtreehouse.com/library/css-foundations/values-and-units/color-values-2

Bahi Hussien
PLUS
Bahi Hussien
Courses Plus Student 13,128 Points

You can put hex in almost all the properties that needs color definitions example

Inline Examples <p style="color:#000000;"></p> <p style="background-color:#000000;"></p> also can be used for border-color

in css sheet

p{ color:#000000; background-color:000000; }

Y#ffff can use the hex before a color for example background-color: #000;

It can also be used in css when adding styles to a div id. For example:

wrapper {

   bacground-color: #fff;

}