JSFiddle - React, Tailwind, and code Playground

by beradrian

HTML

<a id="d1">click me</a>
<div id="parent">
<div id="d2" class="a">Lorem ipsum</div>
</div>

CSS

.a {
  background-color: blue;
  width: 100px;
  height: 100px;
  max-height: 100px;
  display: block;
}

.b {
  background-color: green;
    width: 200px;
  height: 200px;
  max-height: 200px;
}

#parent {
  border: solid 5px red;
}

JavaScript

$("#d1").click(function() {$("#d2").toggleClass("a b"); $("#d1").text("height = " + $("#parent").height()); });