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
-
@olback Tried that but it's stayed left-top. Thanks for the suggestion anyways!
Going to try one more thing and if that doesn't work, fuck it, bootstrap. -
cursee165957yFor horizontal, you can achieve without any new css lines if you are using bootstrap.
div.row
> div.col-sm-4.col-sm-offset-4
>> center
If also considering vertical, you do need css. Yep.
There is nothing wrong with using bootstrap. 🕺 -
Skayo85687y#div {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
}
If only vertically, remove "left: ..." and "translateX()".
If only horizontally, remove "top: ..." and "translateY()".
My favorite solution next to "margin: auto;" -
Wrap it with another div.
.wrapper: {display: flex;}
.content: {margin auto;}
Content is now aligned vertically and horinzontally. -
Brolls31157yI’m not frontend. I hate it with a passion that is still unmatched by a billion exploding suns.
It’s messy. It’s ridiculous. It’s not internally consistent in any way at all.
Simple things are stupidly difficult and yet remarkably complex things like flipping something in 3D using CSS is made trivial (wtf?!)
I feel your pain. So hard. -
@Alice I've always agreed that it's not the size, but how you use it.
But it's a hell of a lot easier to use a big dick -
@Alice Yeah, like smashing rocks with a big hammer is easier than with a small one
-
@Alice I don't think it's appropriate to get graphic and detailed, but if there is more surface area, there is more stimulation. That's where I will end this.
-
donuts236727yWhat happened to the container grid system?
I remember there 12? cells in a row just tell the element to use the middle ones -
I think there's a bootstrap class that offsets the div. Something like col-xs-offset-4
After 3-4 FUCKING hours I finally found a bootstrap thingy which properly centers a div!
In my defense, this shit is all Chinese to me so it's copy-paste-lets-hope-this-works 😅
rant