After I was done working on side bar I wanted to head to the content page to the right so I added a container div that I wanted to set to flex So that I make the two boxes to start styling, but right after adding it, the footer's position is ruined and the side bar isn't taking as much space as it should.
Here's a picture:
.side-bar {
font-family: 'Montserrat', sans-serif;
font-size: large;
font-weight: bold;
display: flex;
justify-content: left;
background-color: rgb(235, 235, 235);
width: 20%;
height: 80%;
flex-direction: column;
}
.side-bar ul {
display: flex;
flex-direction: column;
margin-left: 0%;
list-style: none;
margin-top: 5%;
}
.side-bar ul li {
margin-bottom: 10px;
display: inline;
cursor: pointer;
}
.togglable:hover {
border-radius: 7px;
background-color: rgb(216, 216, 216);
}
.togglable:active {
background-color: rgb(221, 221, 221);
}
.side-bar ul a {
color: black;
text-decoration: none;
}
.side-bar h2 {
font-family: 'Josefin Sans', sans-serif;
margin-bottom: 20px;
}
.container {
display: flex;
}
.task-container {
background-color: red;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ToDoList</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div >
<img src="logo.png" alt="logo">
<nav>
<ul>
<li><a href="#">Services</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<a href="#"><button>Contact</button></a>
</div>
<div >
<div >
<ul>
<li ><img src="gym.png" alt="gym" id="gym"><a href="#">Gym</a></li>
<li ><img src="today.png" alt="calendar" id="today"> <a href="#">Today</a></li>
<li ><img src="week.png" alt="calendar" id="week"><a href="#">This Week</a></li>
<li ><img src="month.png" alt="calendar" id="month"> <a href="#">This Month</a></li>
<h2>Projects : </h2>
<li id="addPr" ><a href="#"><span id="plus-sgn"> </span> Add Project</a></li>
<!-- <li ><img src="checklist.png" alt="checlist" id="list"> <a href="#">Testing</a></li> -->
</ul>
</div>
<div >
<p>Some Text To test the box</p>
</div>
</div>
<div >
<p id="copyright">Copyright © 2021 FaroukHamadi</p>
</div>
<script src="main.js"></script>
</body>
</html>
CodePudding user response:
Add width attribute to task-contianer and add your fotter class attribute on your CSS file.
.task-container {
background-color: red;
width: 100%;
}
.footer{
position: absolute;
bottom: 0px;
width: auto;
}

