I am facing an issue where elements are not centering on my div. I have tried numerous solutions (so many that I finally decided to create a Stack Overflow account), but nothing seems to work.
Interestingly, the elements center on PC but for some reason, they do not center on mobile devices even though I have defined this in the CSS.
.page_content {
background: linear-gradient(90deg, rgba(94, 182, 86, 1) 48%, rgba(121, 230, 111, 1) 100%);
padding: 20px;
width: 100%;
height: 100%;
text-align: center;
margin: auto;
justify-content: center;
top: 0;
bottom: 0;
right: 0;
left: 0;
position: fixed;
}
<body style="color: #efefef">
<div class="page_content">
<h1>Home page</h1>
<button class="button" onclick="testFunction()">Example</button>
<h1>Buttons</h1>
<button class="button" onclick="testFunction1()">btn 1</button>
<br>
<br>
<button class="button" onclick="testFunction2()">btn 2</button>
</div>
</div>
</body>
Any help is greatly appreciated!