Styling Font- Family in CSS

 

Steps in Styling Font-Family:

  1. In styling font-family, you need to use the NOTEPAD.
  2.  Type the following style rule:

    h1{font-family:"arial black";}
    h2{font-family:"century gothic",cursive:}
    p{font-family:"arial black";}
    #sentence1{font-family:"calibri";}


  3. Save this external style sheet as font-family.css
  4. Open another NOTEPAD.
  5. Type the following:

    <html>
    <head>
    <title>Font Family</title>
    </head>
    <body>
    <h1>This heading will have the font arial black</h1>
    <h2>This main heading will have the font century gothic</h2>
    <p>This paragraph wil have the font arial black</p>
    <p id="sentence1">This Sentence will have the font calibri</p>
    </body>
    </html>
  6. Apply your font-family.css style sheet file by inserting a <link> tag in your HTML document similar to this :

    <head>
    <title>Font Family</title>
    <meta charset="ulf-8">
    <link rel="stylesheet" type="text/css" href="font-family.css">
    </head>
  7. Save this HTML document as styling-font-family.html.
  8. Test it in a browser.

 

Sample Output:


 

Comments

  1. How Interesting i could use this someday

    ReplyDelete
  2. now I know how to style my font using css. thanks for this

    ReplyDelete
  3. Thank's for this! Hope you add more codes like this!

    ReplyDelete

Post a Comment