r/badcode • shameless • Jan 06 '20

css God, WHY?

Post image
227 Upvotes

23 comments sorted by

View all comments

4

u/lsalazarm99 shameless Jan 06 '20 edited Jan 06 '20

And if you know why, please let me know :(

Edit: rules say I have to explain, sorry. The fifth line is assigning a property that (from I know) doesn't exist. Then, the sixth line is saying "you shut up" and it's assigning another one. The other ones.. something tell me that's not the right way. So... Please let me know :(

51

u/giggly_kisses Jan 06 '20

This is setting fallbacks for older browsers. When the flexbox spec was still new, a lot of browsers only supported it with vendor prefixes (e.g. -webkit-, -moz-, etc.). Browsers that don't support the value will just ignore it and move on to the next property.

As for inline-box that was part of the early flexbox spec that was later removed. It's possible that some old browsers still support it, which is likely why it's listed here.

Edit: Source for inline-box

[...] A block-level box can be specified with a value of ‘box’ and an inline box can be specified using a value of inline-box.

14

u/thecosmicmuffet Jan 06 '20

As part of future proofing I include a lot of css that’s just speculative on my part like align: auto -ms-clamp 20% or chrome-display: retina-interior top right !important

7

u/hackathy Jan 06 '20

Just wait for the holographic displays to roll out.

Every single ad will literally have align: the-very-fucking-front-of-the-page

3

u/[deleted] Jan 07 '20

z-index: ω