Skip to content
Justice Tech School

Dark Mode

data-bs-theme switches color modes.

Example
<html lang="en" data-bs-theme="dark">
<body>
  <div class="card"><div class="card-body">Dark card</div></div>
</body>
</html>

Exercise

Theme attribute.

data-bs-="dark"

Quiz Test

Which attribute sets color mode?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.