<div class="good">Good contrast</div>
<div class="bad">Bad contrast</div>Color contrast / notebook
Color contrast
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
div {
/* General div styles here */
}
.good {
background-color: #5a80a9;
}
.bad {
background-color: #400064;
}<div class="good">Good contrast</div>div {
font-family: sans-serif;
text-align: center;
font-size: 2rem;
font-weight: bold;
width: 250px;
padding: 30px;
border-radius: 20px;
box-shadow: 4px 4px 4px black;
}
.good {
background-color: #5a80a9;
}<div class="bad">Bad contrast</div>div {
font-family: sans-serif;
text-align: center;
font-size: 2rem;
font-weight: bold;
width: 250px;
padding: 30px;
border-radius: 20px;
box-shadow: 4px 4px 4px black;
}
.bad {
background-color: #400064;
}