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.

CSS How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

Sean Flanagan
Sean Flanagan
33,232 Points

What does # mean?

Hi guys and girls.

This may seem a ridiculous question, but I've only been a member of Treehouse for 3 days. What does # mean please?

Thanks

Sean

2 Answers

Gary Mead
Gary Mead
1,165 Points

The # is the id selector which is used to specify a style for a single, unique element.

Example: < div id="wrapper" > < /div >

And then on your .CSS file, apply formatting to that class:

"#wrapper { max-width: 940px; margin: 0 auto; padding: 0 5%; }"

Michael Austin
PLUS
Michael Austin
Courses Plus Student 7,814 Points

Hi,

It’s used in two areas, for IDs of tags and for colour palettes.

Tag IDs:

<div id=“me”>Hello</div>
#me{color:red}

Colour palettes: The # means that a hexadecimal colour reference will follow. For example #000 is black, #fff is white.

Have a look at this thread on StackOverflow, as it covers both the general and technical side of hexadecimal colours.

http://stackoverflow.com/questions/22239803/css-how-does-hexadecimal-color-work

Sean Flanagan
Sean Flanagan
33,232 Points

Hi Michael. Thanks for the link. I found it very helpful. :-)

Sean

Michael Austin
Michael Austin
Courses Plus Student 7,814 Points

Hi Sean,

Gary’s description is better for tag IDs as it’s related to the video (something I keep overlooking). I’ve covered two bases :)

Sean Flanagan
Sean Flanagan
33,232 Points

Fair enough. You've both been very helpful, in any case. :)