Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
or who still uses this 😀
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); -
Draedus6857yOr you could use display: table / table-cell and make it work on ie8 and responsive on ie9 :) .
-
I even saw a guy using the hidden IE integrated button centering method. Cause buttons in IE center xD
-
@BambuSource I sure as hell use it. If it doesn't work, try margin auto. If that doesn't work, display flex. That's how I roll.
-
Also text-align: center on the parent element, and setting an explicit width on the item to be centered. And display: block if centering an inline by default element like <a>
-
@Mitiko What I don't get: Why does flex still exist if grid is superior?
Oh right, webdevelopment, deprecations take 4 decades. -
@BambuSource Yeah but that's the problem with browsers in my opinion. You can't really have experimental features, because people start using them in production anyway. Flex is wellsupported, Grid is pretty well supported already — difficult to "refactor" all of it afterwards.
So new webdevs get to learn n+1 ways of doing things.
Sorry, ranting mood today.
Related Rants
Remember those margin: auto?
undefined
align-items: center
display: flex
justify-content: center
css
i hate grid