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

CSS CSS Basics (2014) Enhancing the Design With CSS Web Fonts with @font-face

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

format() function

What is the use of format() function. I looked it up on MDN but still dun get it.

1 Answer

Steven Parker
Steven Parker
231,269 Points

The "format()" function specifies what format the font resource uses to help the browser select one it can handle. The argument string must be one of the available types "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

so in this code @font-face { font-family: "whatever"; src: url(location) format(the format) } does the url() function just tell the browser where to find the fomat to download it on the user's pc and the te format appears by the format() wat i mean is wat i the use of url() function

Steven Parker
Steven Parker
231,269 Points

The "url()" is where to get the font, and "formt()" is what kind it is.