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.

HTML Introduction to HTML and CSS Adding a New Web Page Write the CSS

David Gelman
David Gelman
433 Points

Font Question: Do you really need quotes around "Arial" in the following CSS rule?

In this lesson, the teacher puts quotes around the font "Arial". I removed the quotes and the font still stayed the same Arial font. Does it matter if the quotes are included or not, or should I always use quotes when defining a font?

body { font-family: "Arial"; }

1 Answer

It is not necessary if the name of the font does not include spaces, if the font name is composed of two words or more then you need quote marks around it. Example: "Courier New" must have quote marks.

David Gelman
David Gelman
433 Points

Makes sense, thanks for your reply!

Michael Cockrell
Michael Cockrell
Courses Plus Student 542 Points

yeah its easier to start putting them in quotes from the beginning, that way you wont ever have to worry about it. if you start doing it without quotes you may end up in a situation where you are pulling your hair out trying to figure out why something isnt working and hours later you facepalm because you realize it wasnt in quotes!