<main class="container">
  <h1 class="title">Using the rgb() function in CSS</h1>
  <p class="description">Defining colors via <span class="color-method">rgb() function</span></p>
</main>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;800&display=swap');

body {
  min-height: 100vh;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 90%;
  max-width: 420px;
  padding: 16px;
  border: 1px solid rgb(220 220 220);
  border-radius: 4px;
  background-color: rgb(255 239 212);
}

.title,
.description {
  text-align: center;
}

.title {
  font-weight: 800;
  line-height: 128%;
}

.description {
  font-weight: 300;
  line-height: 100%;
  width: fit-content;
  margin: 0 auto;
  background-color: rgb(204 204 204 / 0.96);
  padding: 16px 12px;
  border-radius: 4px;
}

.color-method {
  text-decoration: underline;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.