Skip to content

Instantly share code, notes, and snippets.

@samuraijane
Last active January 28, 2023 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuraijane/fde89b4c3101f9dfc9b39869ba857235 to your computer and use it in GitHub Desktop.
Save samuraijane/fde89b4c3101f9dfc9b39869ba857235 to your computer and use it in GitHub Desktop.
CSS – Box dimensions

CSS 105

Box dimensions

Key terms and phrases

  1. height
  2. width

Starter code

HTML

<ul>
  <li class="bg1">1</li>
  <li class="bg2">2</li>
  <li class="bg3">3</li>
  <li class="bg4">4</li>
  <li class="bg5">5</li>
  <li class="bg6">6</li>
  <li class="bg7">7</li>
  <li class="bg8">8</li>
  <li class="bg9">9</li>
</ul>

CSS

ul {
  list-style-type: none;
}

li {
  color: rgba(20, 20, 20, 0.4);
  display: inline-block;
  font-family: sans-serif;
  font-size: 3rem;
  padding: 20px 60px;
}

.bg1 {
  background-color: cornsilk;
}

.bg2 {
  background-color: cornflowerblue;
}

.bg3 {
  background-color: powderblue;
}

.bg4 {
  background-color: pink;
}

.bg5 {
  background-color: linen;
}

.bg6 {
  background-color: gainsboro;
}

.bg7 {
  background-color: lavender;
}

.bg8 {
  background-color: cadetblue;
}

.bg9 {
  background-color: papayawhip;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment