Hello could someone please tell me why my menu does not go from page to page. Dropdown works but when I click it doesn't go to the subpage. Anticipating the question, I don't want to use JavaScript. Buttons without dropdown menu works. If this cannot be fixed, could someone sent me a menu in similar style without JavaScript.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #333;
}
hr {
border-top: 2px dashed white;
border-bottom: none;
}
a {
text-decoration: none;
color: black;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
}
.navbar {
height: 6vh;
display: flex;
justify-content: space-around;
align-items: center;
width: 60%;
margin: auto;
}
.dropdown {
position: relative;
}
.dropdown ul {
position: absolute;
background: #bebebe;
margin-top: 10px;
width: 200px;
height: 200px;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
list-style: none;
border-radius: 5px;
opacity: 0;
pointer-events: none;
transform: translateY(-10px);
transition: all 0.6s ease;
left: 0px;
}
.dropdown li {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.dropdown li:hover {
background-color: darkslategray;
}
.navbar button,
.deco {
background: none;
border: none;
color: black;
text-decoration: none;
font-size: 18px;
cursor: pointer;
}
.navbar button:hover,
.deco:hover {
color: darkslategray;
}
.dropdown button:focus+ul {
opacity: 1;
pointer-events: all;
transform: translateY(0px);
}
.top {
text-decoration: none;
background: yellow;
border: none;
color: black;
font-size: 48px;
cursor: pointer;
border-radius: 5px;
width: 45px;
height: 45px;
align-items: center;
right: 0;
bottom: 0;
position: fixed;
}
.autor {
color: #bebebe;
font-size: 16px;
}
.printButton {
border: none;
font-size: 18px;
border-radius: 5px;
width: 80px;
height: 20px;
cursor: pointer;
color: black;
background: darkslategray;
}
@media print {
.noPrint {
display: none;
}
}
<header class="noPrint">
<a href="index.html"><img src="https://via.placeholder.com/80" alt="Logo strony" class="center"></a>
<div class="navbar">
<button><a href="index.html" class="deco">Główna</a></button>
<div class="dropdown">
<button>Ciasta</button>
<ul>
<li><a href="biszkopt.html">Biszkopt</a></li>
<li><a href="beza.html">Beza</a></li>
<li><a href="makowiec.html">Makowiec</a></li>
</ul>
</div>
<div class="dropdown">
<button>Pieczywo</button>
<ul>
<li><a href="chleb.html">Chleb</a></li>
<li><a href="bulki.html">Bułki</a></li>
<li><a href="bulkiNaSlodko.html">Bułki na słodko</a></li>
</ul>
</div>
<button><a href="informacje.html" class="deco">Informacje</a></button>
</div>
</header>