Introduction to CSS | Part 2 | Build Your Own Static Website | Cheat Sheet

 

1. Color

The CSS color property specifies the color of the text.

.main-heading {
  color: blue;
}
.paragraph {
  color: grey;
}

Sample Colors


2. Background Color

The CSS background-color property specifies the background color of an element.

.card {
  background-color: lightblue;
}

example:-

HTML Code:-

<!DOCTYPE html>
<html>
  <head></head>
  <body>
    <div class="card">
      <h1 class="main-heading">Tourism</h1>
      <p class="paragraph">Plan your trip wherever you want to go</p>
    </div>
  </body>
</html>
CSS Code:-

.main-heading {
  color: blue;
}
.paragraph {
  color: grey;
}
.card {
  background-color: lightblue;
}

Output:-





Comments

Popular posts from this blog

Introduction to CSS Box Model | Part 1 | Build Your Own Static Website | Cheat Sheet