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 trialAdam Overby
711 PointsSingle quotes vs double quotes font family why the difference?
At around the 3:30 mark in the video Nick enters in the font-family: 'font name' and only puts single quotes around the name.
But for other things like links, class & id's we have been using double quotes ("). how come i use (') for font family.
class="" href="" id="" font-family:' '
is that just the rule???
3 Answers
Shawn Rieger
9,916 PointsYou can use either. It's not a rule no. You should try to stay consistent though when your coding! I don't think he did it for any specific reason.
Tianni Myers
10,453 PointsShawn is right, I think you can use either in HTML. But for other languages like PHP and I think JS, single quotes are strings and doubles are values.
Shawn Rieger
9,916 PointsActually, you can use either or in both languages. PHP basic string is single quotes while double quotes can be a generic string or process variables inline among other things. Check out
Likewise JavaScript you can use either single or double. It's the developer's preference. Just try to be consistent. With ES6 you can use back-ticks `` and do stuff like `Hello ${name}! Welcome!
`
Adam Overby
711 PointsThanks for the taking the time to post