reading-notes

🗒️ Class 05: Design web pages with CSS

What is CSS

CSS Stands for Cascading Style Sheets. CSS is used to style a website. Here is an example of CSS Code

h1 {
color: goldenrod;
font-size: 2rem;
}

Css is made up of 2 parts - the selector and the declaration. In the example above, h1 is the selector and color: goldenrod; is the declaration. The declaration can be broken into two parts. To the left of the : is the property(color), and to the right is the property value(goldenrod).

Three things to remember

We can also select multiple selector. all we would have to do is add a commas between them.

h1,
.header-text,
.page-title {
color: goldenrod;
font-size: 2rem;
}

Three (3) ways to insert CSS into your project

<link rel="stylesheet" href="style.css">
<style>
  .class{
    font-weight: 600;
  }
</style>
<p style="color: red;"> Red Paragraph </p>

CSS rule that would give all <p> elements red text

p {
color: red;
}

Different ways to add color to an element