Why does CSS never work the way you'd expect? All I want to do is align something to the bottom of a div. No. Will not happen. You'd think it might be something simple as 'v-align' or 'align: bottom' or 'fucking put it at the bottom: now;'

No, it's never that simple. I try every result I can find from googling. Nothing. Simply does not work.

How about trying to keep a div to a square when you resize the page? That should be simple? height = width right? Fuck you. Ha hahah, no you have to implement some horrendous arcane hack involving fake elements and other bullshit.

You finally fix one thing and everything else you had working is now broken.

...and then some fuckwit comes along and goes "Oh, CSS isn't hard..." and it takes everything you have not to beat them to death with your rubber duck.

What the hell is wrong with CSS? It's not even programming! It's just pure, sadistic hell! FUCK CSS!!!!

  • 14
    you should really check flexbox. browser support is getting better
  • 0
    That "align to bottom of div" was the major stumbling block of my last site build... Even with SO it took me AGES!
  • 3
    @kargaroth Been messing around with flexbox for a few minutes now and things are actually coming together.

    Thank you sir, you may have just made my life significantly easier.
  • 0
    you using sass?
  • 6
    Position: fixed;
    Bottom: 0px;

    For flex to work you need a full page container, which isn't always an option. For this it isn't necessary.
  • 0

    That fixes it at the bottom relevant to the page. I want it at the bottom of its parent element.

    Thanks for the help though.
  • 1
    Lol your rant is actually a RANT!
    After that watching your first comment about flexbox is funny!
    I was about to suggest it as well.
    I use it in all projects. Fuck old browsers.
  • 1
    @Ratwerks Sorry, I didn't read it thoroughly enough. @tweichart is correct.
  • 13
    Surprisingly, with the help of this thread, probably 70% of my CSS pain has gone and I didn't even come here to ask for help, just rant.

    I finished the thing I'm working on to the point where I'm calling it 'good enough' and moving on. Thanks guys. You're all what Stack Overflow wishes it was.
  • 4
    Look at that. Dev was able to vent and others helped. All without name calling or belittling.
  • 1
    Not always an option, but whenever I have difficulties doing what I want with CSS, I take a step back and see if my HTML needs to be structured slightly differently in order to accomplish my goal.

    Sometimes some simple HTML changes make the CSS a lot simpler.
  • 3
  • 0
    Flexbox and align-items or justify-content (depending on wether you are using rows or columns as flex- direction) should do the trick.
  • 0
    @Swifticus agreed. When I start looking at hacky stuff like negative margins and even absolute positioning I know it's time to reconsider a reorder or restructure of the source html if possible. That usually solves the problem with half the effort and seems to be more 'solid.'
Add Comment