JSFiddle - React, Tailwind, and code Playground

by jimousse

HTML

<div class="parent">
  <div class="child1">
    child 1
  </div>
  <div class="child2">
    <button class="mybutton">
			<span class="magic">
				<div class="grandchild2">
					blabla
				</div>
			</span>
    </button>
  </div>
</div>

CSS

.parent {
  height: 150px;
	width: 200px;
  display: flex;
  flex-direction: column;
  background: salmon;
  border: 2px solid black;
}

.child1 {
  background: red;
}

.child2 {
  background: grey;
  flex-grow: 1;
  flex-basis: 0;
  display: flex;
	width: inherit;
}

.grandchild2 {
  height: 100%;
  background: pink;
	width: inherit;
  border: 2px solid blue;
}

.mybutton {
	flex-grow: 1;
  background: purple;
	display: flex;
	display: -webkit-flex;
	flex-direction: column;
	-webkit-flex-direction: column;
	width: inherit;
}

.magic {
	flex-grow: 1;
	width: inherit;
}