Hi guys, can anyone tell me how can I fit my other div inside the
sidebarclass? I'm having a problem because my sidebar has a width of260pxand it's alsoposition:fixed. I've tried usingwidth: 100%still not working and I've also set a position relative to my main classside-navand still not working I thinkposition relativeis not working on fixed position. Please help thanks
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
.sidebar {
position: fixed;
top: 0;
height: 0;
height: 100%;
width: 260px;
background: blue;
}
.sidebar .logo-dtls {
height: 60px;
width: 100%;
display: flex;
align-items: center;
}
.sidebar .logo-dtls i {
font-size: 30px;
color: #fff;
height: 50px;
min-width: 78px;
text-align: center;
line-height: 50px;
}
.sidebar .logo-dtls .logo {
font-size: 22px;
color: #fff;
font-weight: 600;
}
/* NAV */
.sidebar .side-nav {
/* background: red; */
height: 100%;
padding-top: 30px;
}
.sidebar .side-nav li {
position: relative;
list-style: none;
transition: 0.4s ease all;
}
.sidebar .side-nav li i {
height: 50px;
min-width: 78px;
text-align: center;
line-height: 50px;
color: #fff;
font-size: 20px;
}
/* PROFILE CSS */
.sidebar .profile-c {
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
background: black;
}
.sidebar .profile-c .profile-c {
display: flex;
align-items: center;
}
.sidebar .profile-c img {
height: 52px;
width: 52px;
object-fit: cover;
border-radius: 16px;
margin: 0 14px 0 12px;
background: red;
padding: 10px
}
.sidebar .profile-c .profile_n,
.sidebar .profile-c .job_n {
color: #fff;
font-size: 18px;
font-weight: 500;
}
.sidebar .profile-c .job_n {
font-size: 12px;
}
<!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>Document</title>
<link rel="stylesheet" href="../materials/fonts/new/fonts.css">
<link rel="stylesheet" href="../materials/css/style.css">
<script src="../materials/plugins/jquery-3.6.0.js"></script>
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
<!-- <script type="text/javascript" src="../materials/js/function.js"></script> -->
</head>
<body>
<div class="sidebar">
<div class="logo-dtls">
<i class='bx bxl-xing'></i>
<span class="logo">XingX</span>
</div>
<ul class="side-nav">
<li>
<div class="profile-c">
<div class="profile-w">
<img src="../materials/media/logos/test.jpg" alt="">
</div>
<div class="name">
<div class="profile_n">BiroCokoco Duenviake</div>
<div class="job_n">System Designer</div>
</div>
<i class='bx bx-log-out' ></i>
</div>
</li>
</ul>
</div>
</body>
</html>