I'm trying to create a website whose body up the middle 60%. I thought I'd do this:
body {
align-items: center;
text-align: left;
justify-content: center;
width: 60%;
}
But that's not working :(
I even tried using translateX to translate right 20%
Any advice? Suggestions?
You can achieve it easily using CSS grid. Here's the MDN reference: https://developer.mozilla.org/en-US/docs/Web/CSS/grid
Example:
HTML file
<div class="container">
<div class="content">
Some content
</div>
</div>
CSS file
.container {
display: grid;
grid-template-columns: 20% 60% 20%;
}
.content {
grid-column: 2;
}
ooo that worked, thank you so much!