I'm struggling to center the content on a desktop viewport, despite trying various methods. Could someone help me?
andreiz53
@andreiz53All comments
- @hnasser44Submitted over 1 year ago@andreiz53Posted over 1 year ago
You could apply max-width on your "main" HTML tag.
Also, for layouts I would recommend using grid instead of flex. You could move your 'header' outside of the 'main' tag, then apply the following on your 'main' tag:
- display:grid,
- grid-template-columns: 1fr 1fr - creates 2 equal columns,
- align-items:center - aligns them vertically.
Marked as helpful0 - @DESELMAARSubmitted over 1 year ago
any helps or suggessions are welcome , I'm beginner, thank you,
@andreiz53Posted over 1 year agoI see that your body is not centered. You could apply margin-inline:auto in order to center the elements.
On mobile resolutions the bottom background is not really on the bottom of the page. Apply bottom: 0; on your 'gray-bg' class, then apply position: relative; on the body and watch the magic happen :D then you can work on your heights for the backgrounds.
Marked as helpful0