Currently, I am facing an issue with a div
element that is supposed to be a square and remain so regardless of the device being used. My challenge lies in centering a FontAwesome icon within this square across all screen sizes. Despite my efforts, the desired result has not been achieved.
On desktop, the icon appears horizontally and vertically centered, as shown below:
https://i.sstatic.net/S4JcH.png
However, on mobile devices, the icon is no longer perfectly centered, leading to the following appearance:
https://i.sstatic.net/bKRdB.png
I am seeking a solution that does not involve using media queries. You can view the code and experiment further on my Codepen.