As a newcomer to Ionic, HTML, and CSS, I am currently exploring how to keep a button fixed while scrolling through the page. Despite specifying a fixed position in the CSS, the button does not remain fixed as intended.
The button seems to be having trouble staying fixed at the bottom of the page.
.fix-bottom {
position: fixed;
width: 100%;
bottom: 0px;
left: 0px;
}
.d-flex {
display: flex;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
}
<div class="fix-bottom btn-shadow ">
<div class="d-flex">
<button ion-button full (click)="addToCartProduct()" style="width: 50%; height: 45px;background-color: #3498db">ADD TO CART</button>
<button ion-button full style="width: 50%; height: 45px;background-color: #f53d3d;" (click)="proceedToCheckOut()">BUY NOW</button>
</div>
</div>