To change the width: 48px;
, you can use flex: 0 0 48px;
as it represents:
flex-grow: 0;
flex-shrink: 0;
flex-basis: 48px;
This means that the element will neither grow nor shrink and will have a fixed size of 48px.
Alternatively, you could go with:
width: 48px;
flex-shrink: 0;
By default, a flex item has flex-shrink: 1
, so specifying flex-shrink: 0
is necessary in this case to prevent shrinking.
Another approach would be using:
min-width: 48px;
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.red-label {
color: red;
}
.fs-small {
font-size: 0.8em;
}
.fs-smaller {
font-size: 0.5rem;
}
.user-avatar {
background-repeat: no-repeat;
background-size: cover;
background-color: white;
background-position: center;
height: 48px;
flex: 0 0 48px;
background-image: url('https://placehold.co/48x48');
}
.ellipsis-2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; /* number of lines to show */
line-clamp: 2;
-webkit-box-orient: vertical;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="74161b1b00070006150434415a475a47">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="debcb1b1aaadaaacbfae9eebf0edf0ed">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
<div class="accordion-body row g-3">
... (The rest of the content remains unchanged)
<div class="px-3 pe-4 m-3 text-end">
<a href="#">View All</a>
</div>
</div>