Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change Bootstrap class based on variable value.
<div class="col pt-3 pb-3 alert bg-light mr-3">
if ($total_dash > 500) {
$high_alarm = "text-danger";
} else {
$high_alarm = "text-dark";
<div class="font-weight-regular mb-0 h2 <?php echo $high_alarm ?>"><?php echo $total_dash; ?></div>
<div class="text-dark">Active Alarms</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.