My website has a responsive menu, and I am attempting to make other parts of the site responsive using media queries.
I implemented two media queries but now the responsive menu is no longer functioning, and I cannot figure out why.
@media (min-width: 768px) and (max-width: 980px)
@media (max-width: 767px)
Below is the code for the menu:
CSS
.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f6f6f6;
border: 1px solid #d1d1d1;
}
... // CSS code continues
<p>HTML</p>
<pre><code><div class="topnav" id="myTopnav">
<a <?php echo ($page == "information") ? "class='active'" : ""; ?> href="/nutickets2/index.php">INFORMATION</a>
... // HTML code continues
</div>
JS
<script>
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
</script>
I added the following code to make the site responsive:
@media (min-width: 768px) and (max-width: 980px) {
.text-head-div div {
display: block;
}
.text-head-div span {
display: block;
}
}
@media (max-width: 767px) {
.text-head-div div {
display: block;
}
.text-head-div span {
display: block;
}
}
After adding this code, the responsive menu stopped working. Removing it restores functionality.