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
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Koolstr27938yI totally feel you. A lot of times I have so much freaking trouble vertically centering things, even with all of the different resources online that I've tried! There's gotta be a simple way to overwrite all other stylings to ensure that your vertical centering takes priority. Otherwise this is just going to eat a lot of precious dev time.
-
Flexbox items are sized with flex, which can be set to an arbitrary integer depending on how you want it to size.
Flex 1 with no other siblings with flex still expand that item to its max size. Another item with Flex 1 will share that expanded size equally.
Say one item is Flex 2 and the other is Flex 1, you have a total of 3 slices to share, one get 2/3 and the other 1/3.
That's the most rudimentary explanation I can think of. -
I don't see what's hard about it. Just those two lines will do. If some other css is breaking it, use the inspector to turn them off and find the culprit, then kill it by removing / resetting the rule.
-
chzbgr9368yhttp://sketchingwithcss.com/samplec...
Use vh and vw instead of percent, should work on chrome then. -
Kalvin12388y@king This is the most straightforward, bullshit-free answer​ I've ever seen. You should feel proud. Damn, your offspring should be proud too!
-
richo97588yI. Use flex box
II. Don't do web development gigs
III. Mobile is better.
IV. I'm new please don't hurt me. -
yo-yo13648yBecause people are too proud to admit that their work is flawed from the very beginning.
-
richo97588y@chzbgr thank you I thought this is going be like stack overflow where virtually every contribution is instantly down voted into oblivion.
-
hourd1088yMight I suggest you try http://flexboxfroggy.com
It's a nice little game that teaches you how to do most layouts in flexbox.
I used it to learn to use it myself. -
netzc38ySo let it be hard, master it and feel good about charging customers for it.
In case this sounded patronizing:
- not my intent. Sorry.
Also: isn't cracking the harder nuts what makes us feel good about our work?
Take a step back, grab a coffee and 'once more unto the breach' you'll get there! -
@hourd yeah I saw that in my comb prong tab bar last night. That was 1 of the 6 hours.
-
@hourd
Absolutely, it helped me understand what I was actually doing, and it was a nice break from utter hell. -
@hourd whoop I miss read your comment.
It did help me understand, however, the css gods hated me yesterday and nothing worked at all.
Related Rants
-
cdrice105"You gave us bad code! We ran it and now production is DOWN! Join this bridgeline now and help us fix this!" ...
-
MoboTheHobo35My Friend: Dude our Linux Server is not working anymore! Me: What? What did you do? My friend: Nothing I swe...
-
tommy15Right now someone at Google is coding something useless for us to laugh at on April Fools.
It's 2017.
Why is vertically centering a div still so stinkin hard?
Yeah yeah ik what you will tell me, "use flexbox".
Well guess what,. I HAVE BEEN TRYING TO FOR THE PAST 6 FUCKING HOURS!
I've gone as far as to copy code from 20+ different websites advertising working solutions. My tab bar looks like the fucking rockey mountains!
My main problem is that flexbox on chrome is not accepting ANY % values.
Now if you'll excuse me, I need to go kill myself. YAY! 🤗
undefined
fml
i hate css