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
-
@bigworld12
android:layout_centerInParent="true"
Or
Constraint layout
#justAndroidThing
But ya wen is pretty much annoying but things are getting easy I guess, not a web dev tbh -
@bigworld12 by the way xaml designing is so easy and gets shit done in no time, then comes Android then never iOS and web lol
-
Before flexbox maybe, but, with flexbox:
.container {
display: flex;
align-items: center;
justify-content: center;
} -
PaaPsik10416y@tizo this is oldschool, i use all the time. Works with older browsers real good. I do top:50%; left:50%; transform:translate(-50%,-50%); to cemter it vertically and horizontaly
-
Thank god for flexbox eh? We can finally do something tables could do in the 90s. Not that I'm advocating tables, that would be crazy.
-
vicary4816y@tizo Centering usually comes with the constraint of parent container size, mimicking background-size: cover/contain in some way. Last time I messed with translate-* family they renders the element in another plane of existence where you can’t do anything with overflow and z-index.
Related Rants
At least once!
joke/meme
css
vertically center