When I click the hamburger icon, it changes to the close icon, and my navbar briefly expands before collapsing back. The same issue occurs when I click the close button, with the nav items briefly becoming visible. I have included my CSS for mobile widths but I can't seem to figure out the problem. Any help would be appreciated!
HTML
<html lang="en">
<head>
...
</head>
<body>
<nav class="navbar navbar-inverse navbar-expand-lg navbar-light">
...
<div class="collapse navbar-collapse" id="navbarText">
...
</div>
</nav>
CSS max width 376px
@media (max-width:376px){
...