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

HTML

FABIAN TRUJILLO
FABIAN TRUJILLO
878 Points

help with google fonts

cant get the font style to show up for me please can someone tell me what im doing wrong. <!DOCTYPE html>

<html lang="en">

<head>



    <link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">

    <link rel="stlyesheet" type="text/css" href="resources/css/style.css">

    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,300i,400&display=swap" rel="stylesheet" type="text/css">



    <title>Omnifood</title>

</head>

<body>

    <h1>Omnifood</h1>

</body>

</html>

the font style just stays the same and not to the one i want

1 Answer

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

The font will stay the same if all you have done is linked it in your html document.

You need to select an element in your stylesheet that you want to use the font.

E.g. if you want all your elements to have the font then use the body tag, providing you haven't individually targeted any element and given them a font property. As this will override the below example code.

body {
  font-family: 'Lato', sans-serif;
}
FABIAN TRUJILLO
FABIAN TRUJILLO
878 Points

Hello thank you for your response, yes so this is how i have it in my css file.

*{ margin: 0; padding: 0; box-sizing: border-box; } html { background-color: #fff; color: #555; font-family:'Roboto', sans-serif; font-size: 20px; font-weight: 300px; text-rendering: optimizeLegibility; }

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

in your html css rule you have chosen the font "Roboto" to be used on the page, you should change that to Lato if you want the font you linked to be included and working in the elements.

html {
  font-family: 'Lato', sans-serif;
  background-color: #fff;
  color: #555;
  font-size: 20px;
  font-weight: 300; /* Removed the px unit at the end of the value as you previously added, this won't work. */
  text-rendering: optimizeLegibility;
}