I'm facing an issue with two fixed elements positioned at the bottom of my webpage:
#wrapper {
position: fixed;
background: gray;
color: #fff;
bottom: 0;
left: 0;
right: 0;
border-radius: 12px 12px 0 0;
width: 100%;
}
#bottom-element {
height: 30px;
position: fixed;
background: black;
display: block;
bottom: 0;
z-index: 2;
width: 100%;
left: 0;
right: 0;
}
#title {
text-align: center;
padding: 15px;
border-bottom: 1px solid white;
}
#notifications {
display: flex;
flex-direction: column;
overflow: scroll;
overflow-x: hidden;
}
.entry {
padding: 15px;
background: cadetblue;
}
<div id="wrapper">
<div id="title">Notifications</div>
<div id="notifications">
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
</div>
</div>
<div id="bottom-element"></div>
The challenge I'm encountering is that the last entry is getting hidden under bottom-element
. I've already attempted to add these styles to the notifications element:
padding-bottom: 30px
margin-bottom: 30px
I also tried using a pseudo-element:
#notifications::after {
content: '';
width: 100%;
height: 30px;
display: block;
}
Despite trying these fixes, nothing seems to work. How can I address this issue?