Add Google fonts to your website

Ever imagined how some websites just look so professional than others even when the design is so simplistic, well all thanks to Google fonts. Google fonts are used by "many" websites these days to make their websites look more professional and beautiful.
So Let's move to the implementation of Google fonts.

This is the basic structure of your website:


<!DOCTYPE html>
<html>
<head>
<title>Hackslang</title>
</head>
<body>

<p> This is my font</p>

</body>
</html>


Step 1: Go to Google Font website.

Step 2:Select the font by clicking the + symbol on any font block.

Step 3: Now your font is selected , click on the Family Selected block which will be there at the bottom of your screen.

Step 4: copy the link give in the block like <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> and paste it inside the head tag in your html page like this


<!DOCTYPE html>
<html>
<head>
<title>Hackslang</title>
        <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>

<p> This is my font</p>

</body>
</html>


Step 5: Now add the font-family attribute to your block in css and see the magic.


<!DOCTYPE html>
<html>
<head>
<title>Hackslang</title>
        <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>

<p style=" font-family: 'Roboto', sans-serif; "> This is my font</p>

</body>
</html>



The font-family:'Robto',sans-serif will be give just below the font link in the website.

Comments

Popular Posts

NOT SO COMMON C++ : Access Specifiers

Why to choose C# ? - for Beginners

Li-Fi - Experience The Lightning Speed