text-align: center
or
margin: auto
or
grid
or
flexbox
It’s really not that hard now.
Comment on No JS, No CSS, No HTML: online "clubs" celebrate plainer websites
SonOfAntenora@lemmy.world 9 months agoCSS is mostly evil when you have to center elements in the page.
text-align: center
or
margin: auto
or
grid
or
flexbox
It’s really not that hard now.
What if I still have to support IE6?
Don’t
I got you covered:
position: fixed; left: 50%; transform: translateX(-50%);
In a position relative parent
Then your life choices should be of more concern then centering a div.
Someone will thank you for your service. Not me, but someone.
Then quit your job and get one that doesn’t need to worry about stuff Microsoft doesn’t support anymore.
I made a promise, Mr. garretble: a promise. “Don’t you make me use any other browser,” said my nan; and I don’t mean to. I don’t mean to.
She’s still using Windows XP.
Zexks@lemmy.world 9 months ago
Learn flex forget pixels and screen measurements.