JSFiddle - React, Tailwind, and code Playground

by Muhammad Aref

HTML

<!-- secTitle margin goes outside the container -->
<div class="container">
    
    <h1 class="secTitle">Container without <code>overflow: hidden</code></h1>
    
</div>

<!-- works fine here -->
<div class="container overflow">
    
    <h1 class="secTitle">Container with <code>overflow: hidden</code></h1>
    
</div>

CSS

.container {
    background: #ccc;
}

.container.overflow {
    overflow: hidden;
}

.secTitle {
    margin: 30px 0;
}

code {
    color: blue;
}