My layout is set up as follows:
I am encountering an issue when resizing the window, as there is overlap with the main content.
Here is an example of the issue
How can I prevent this overlap while still maintaining padding?
Below is my HTML and CSS code:
<body>
<div class="sidebar">
<a href="#">test</a>
<a href="#">test</a>
<a href="#">test</a>
</div>
<div class="container col-xxl-8 px-4 py-5 main_gradient" id="fade">
<div class="row p-4 pb-0 pe-lg-0 pt-lg-5 align-items-center rounded-3 shadow-lg main_gradient " style=" background-color:rgb(240, 240, 255)">
</div>
</div>
</body>
.sidebar {
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
position: fixed;
height: 100%;
overflow-y: auto;
}
.sidebar a {
display: block;
color: black;
padding: 16px;
text-decoration: none;
}
.sidebar a.active {
background-color: #04AA6D;
color: white;
}
.sidebar a:hover:not(.active) {
background-color: #555;
color: white;
}
@media screen and (max-width: 700px) {
.sidebar {
width: 100%;
height: auto;
position: relative;
}
.sidebar a {
float: left;
}
div.content {
margin-left: 0;
}
}
@media screen and (max-width: 400px) {
.sidebar a {
text-align: center;
float: none;
}
}
I attempted to add padding, but unfortunately it did not resolve the issue.