Cascading Style Sheets

determining how a webpage looks

Coding - CSS

Linking a CSS file

creating a CSS file and linking this to your HTML

HTML file
<link rel="stylesheet" href="mystyle.css">
CSS file
body {
  background-color: lightblue;
}
Coding - CSS

Basic CSS syntax

body {
  background-color: lightblue;
}

h1 {
  color: white;
  text-align: center;
}

p {
  font-family: verdana;
  font-size: 20px;
}
Coding - CSS

Styling certain elements

We can give a certain tag an id in order to differentiate it from other tags of the same type like this: id="para1"

Then in our CSS code we can refer to this specific tag using the following selector:

#para1 {
  text-align: center;
  color: red;
}
Coding - CSS
Coding - CSS