I am currently designing a mobile version of my website that resembles an app. The issue I'm facing is with the menu icon at the bottom, which is supposed to trigger a modal when clicked, but it's not working as expected. I suspect it may have something to do with the z-index. Is there a way to resolve this using only CSS? My framework is Bootstrap 4.
Here is the link to my codepen
.footer-container-mobile {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 10;
height: 54px;
background-color: #8ABE57;
width: 100%;
margin: 0 auto;
padding: 10px 40px;
box-shadow: 0px -4px 8px rgba(0, 0, 0, 0.1);
}
.footer-container-mobile i {
color: white;
font-size: 1.3em;
margin-top: 5px;
}
.circle-btn-mobile {
width: 70px;
height: 70px;
border-radius: 50%;
background-color: #31353C;
color: white;
text-align: center;
align-items: center;
font-size: 2em;
filter: drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.30));
display: flex;
flex-direction: row;
}
.circle-btn-mobile-container {
width: fit-content;
margin: 0 auto !important;
z-index: 50;
position: fixed;
bottom: 12px;
left: 0;
right: 0;
}
<!-- Bootstrap CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9cfef3f3e8efe8eefdecdca8b2a9b2af">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<div class="container-fluid">
<div class="row d-flex footer-container-mobile dropdown">
<a href="#" class="mr-auto" data-toggle="modal" id="modalServiceMenuMobile"><i class="far fa-bars">Menu icon</i></a>
<a href="#" target="_blank" class="ml-auto"><i class="fas fa-user-plus"></i>Icon</a>
</div>
<div class="row circle-btn-mobile-container">
<div class="d-flex justify-content-center mx-auto circle-btn-mobile">
<i class="far fa-plus">+</i>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalServiceMenuMobile" tabindex="-1" role="dialog" aria-labelledby="modalServiceMenuMobile" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>