HTML CSS

Description

CSS stands for Cascading Style Sheets.
CSS saves a lot of work. It can control the layout of multiple web pages all at once.

  • Use the HTML style attribute for inline styling
  • Use the HTML <style> element to define internal CSS
  • Use the HTML <link> element to refer to an external CSS file
  • Use the HTML <head> element to store <style> and <link> elements
  • Use the CSS color property for text colors
  • Use the CSS font-family property for text fonts
  • Use the CSS font-size property for text sizes
  • Use the CSS border property for borders
  • Use the CSS padding property for space inside the border
  • Use the CSS margin property for space outside the border

Tutorial Videos

Step 1

First reference the CSS file in your html.
You must do this in the <html> element.

Step 2

Let change the background color of the whole page first.
You first write down the element.

Step 3

Now write the brackets as you can see in the image.
In those brackets you will write down the changes you want to see.

Step 4

To change a certain pharagraph or header, write down the element.
Each pharagraph or header will change to the written CSS.
This time lets change the letterype and the textcolor as well as the font size.

Step 5

The end result will look like the image.

Exercise

blanditiis harum quisquam eius sed odit fugiat iusto fuga praesentium optio, eaque rerum! Provident similique accusantium nemo autem. Veritatis ouga? Ipsa laudantium molestias eos

Exercise 1

Use CSS to set the background color of the document (body) to yellow.

<!DOCTYPE html>
<html>
<head>
<style>
...
...:yellow;
...
</style>
</head>
<body>
<h1>My Home Page</h1>
</body>
</html>

The Correct Answer

Exercise 2

Use CSS to set the text color of the document to red.

<!DOCTYPE html>
<html>
<head>
<style>
body {
....:red;}
</style>
</head>
<body>
<h1>My Home Page</h1>
</body>
</html>

The Correct Answer