<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<iframe height="720" style="width: 33.33%; margin: 0 auto;" scrolling="no" title="Bootstrap 4.x - Transform hamburger menu to close (X) with animation" src="https://codepen.io/bryanrojasq/embed/OJNvNxy?height=265&theme-id=light&default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/bryanrojasq/pen/OJNvNxy'>Bootstrap 4.x - Transform hamburger menu to close (X) with animation</a> by Bryan Rojas
(<a href='https://codepen.io/bryanrojasq'>@bryanrojasq</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>