Im trying to make a div within a flex container a clickable link.
.container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 30px;
}
.flex_container {
display: flex;
justify-content: space-around;
}
.box {
background: silver;
width: 25%;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid black;
}
<header>
<div class="container flex_container">
<div class="box">link1</div>
<div class="box">link2</div>
<div class="box">link3</div>
<div class="box">link4</div>
<a href="example.com"><div class="box">link5</div></a>
</div>
</header>
Im trying to make the 4 divs in the container div clickable links. Putting a hyperlink around them as such: <a href="example.com"><div class="box">link</div></a>destroys the layout of the container.
Basically, Im trying to make a top menu bar, with 4 boxes, covering the whole width of the screen.
Thank you.