In this lesson, you will learn how to style webpages.
Styling webpages can be either adding a background color to your webpage or changing the color, font family, or size of the text and more. In this lesson, we will style webpages using a different way, not the same way that we used in the previous lessons.
The first way is to use the <style>…</style> tags. They are placed between the <head>…</head> tags. Write the following code in an empty Wordpad:
You should see the following in your web browser:
Now, we will use another way to style webpages. Mainly, we will use something called CSS. CSS stands for Cascading Style Sheets. You can also use multiple style sheets for your webpages. Write the following code in an empty Wordpad:
The path of the stylesheet is written between the href=””.
Now, create a new Wordpad file and save it with the “.css” extension. Add the following code to your CSS file:
You should see the following webpage:
Note: All CSS files must end with the “.css” extension.