the First problem is why I cant have the button in the middle of the page?? although I am typing
Right: 50%;
OR even
Left: 50%;
I feel the balance is incorrect.
the second problem is why I have white spaces on the edges of the page in mobile or tablet size screen after using the media queries on both in CSS?? although I tried to use
Margin: 0px;
Or even padding: 0px;
but it still did not work for me.
// At the top of the CSS
html,
body {
height: 100%;
padding: 0;
}
.nav-bar-page1 {
position: absolute;
left: 50%;
bottom: 0%;
transform: translateX(-50%);
}
Yes sorry I did actually want to explain it but I got distracted and wanted to at least post the CSS.
Let me try, I might do a horrible job of this.
So we push the element from the left 50%. Now the left side of the element box is in the center, but we want the center of the element box to be in the center. So we move the element back by -50% of itself (i.e. half its width). Now the center of the element box is in the center of the parent container.
You can use the same technique to horizontal and vertical center an element inside the parent container.