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
Dan Murphy
589 PointsWhat does the '.' on .profile-photo do in my CSS? http://screencast.com/t/6og10y3W
What does the '.' on .profile-photo do in my CSS? http://screencast.com/t/6og10y3W
3 Answers
Ryan Dudley
Treehouse Project ReviewerThis just signifies that you are using a class selector. So to select an element with a specific class attribute in our HTML, we use the . character followed by the class name.
For example in your HTML you might have something like this :
<div class="someclass">
So in our css we would use the class selector to target this by typing a . then the classes name :
.someclass {
}
Hope this helps!
Ben Bastow
24,657 PointsHi!
the . means you are accessing a class :) and the same works for id's so you would use # to access a class.
if i had a class called hello then i would access it by doing .hello{}
if i had an id called hello then i would access it by doing #hello{}
I hope this helps! if you have anymore questions feel free to ask!
Richard Rogers
18,880 PointsHi Dan,
What you see here is the class "profile-photo". Whenever we see a "." followed by text in a CSS file, in this case ".profile-photo", we are looking at the values given to to the class linked to whichever HTML file the current CSS file is working alongside.
In this case, if you reference back to your HTML file, you should see a class labeled as, ' class = "profile-photo" '.
-Richard