JSFiddle - React, Tailwind, and code Playground
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
background-color: #ffffff; /* Set a background color for better visibility */
}
.booleanDiv {
display: flex;
align-items: center;
justify-content: center;
width: 100px;
height: 50px;
border-radius: 5px;
font-weight: bold;
text-align: center;
color: #ffffff; /* Text color */
}
.trueValue {
background-color: #4CAF50; /* Green background for true value */
}
.falseValue {
background-color: #f44336; /* Red background for false value */
}
.icon {
margin-right: 5px;
}
</style>
</head>
<body>
<!-- Example usage -->
<div class="booleanDiv trueValue">
<div class="icon">✓</div> <!-- Checkmark icon for true -->
True
</div>
<div class="booleanDiv falseValue">
<div class="icon">✗</div> <!-- Cross icon for false -->
False
</div>
</body>
</html>