MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/s50nbi/cool_css_trick_found_at_work/
r/badcode • u/eldiablo799 • Jan 16 '22
13 comments sorted by
56
I'm guessing it's bad because you could just put all the Mediascreen functions in one thing instead of multiple
21 u/[deleted] Jan 16 '22 And the rule overwrite in the same file 9 u/devenitions Jan 16 '22 And some !important, and an overload of negative margins and a random utility class 1 u/[deleted] Jan 18 '22 I don't know CSS but that's what I assumed too
21
And the rule overwrite in the same file
9
And some !important, and an overload of negative margins and a random utility class
1
I don't know CSS but that's what I assumed too
19
Image Transcription: Code
@media screen and (max-width: 1100px) { .hero-banner { margin-bottom:120px !important; margin-top: -30px; } } @media screen and (max-width: 1100px) { .title-h3 { margin-bottom: -30px; margin-top: -25px; } } @media screen and (max-width: 1100px) { .hero-banner-button { margin-bottom: -120px; margin-top: -10px; } } @media screen and (max-width: 1100px) { .hero-banner { margin-bottom:30px; margin-top: -34px; } } @media screen and (max-width: 1100px) { .sub-hero-banner { margin-bottom: -30px; margin-top: 10px; } } @media screen and (max-width: 1100px) { .space-to-hide { display:none; } } @media screen and (max-width: 1100px) { .number-home { display:none; } } @media screen and (max-width: 1100px) { .client-logo { width: 10px !important; } } @media screen and (max-width: 1100px) { .figure-3-steps { display:none; } }
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
When back Enders write css. I’m surprised there aren’t any floats or absolute positioning here
4 u/doyouseewhateyesee Jan 16 '22 probably couldn’t figure out why their absolute positioning wasn’t working 1 u/[deleted] Jan 18 '22 What's wrong with floats?If I'm just making a static site with a sidebar, I don't think that would cause much of an issue. 2 u/NastroAzzurro Jan 18 '22 Floats cause issues with positioning of neighbouring items, for which the clearfix Bandaid was invented. Floats have a place, but only to do what they were meant for: allowing text to wrap around an item. They’re not to position a sidebar.
4
probably couldn’t figure out why their absolute positioning wasn’t working
What's wrong with floats?
If I'm just making a static site with a sidebar, I don't think that would cause much of an issue.
2 u/NastroAzzurro Jan 18 '22 Floats cause issues with positioning of neighbouring items, for which the clearfix Bandaid was invented. Floats have a place, but only to do what they were meant for: allowing text to wrap around an item. They’re not to position a sidebar.
2
Floats cause issues with positioning of neighbouring items, for which the clearfix Bandaid was invented. Floats have a place, but only to do what they were meant for: allowing text to wrap around an item. They’re not to position a sidebar.
Maybe just a beginner, who doesn't understand media-queries?
4 u/perceivedpleasure Jan 17 '22 yes but its still bad code nonetheless 1 u/twity1337 Jan 17 '22 True. Every piece of bad code has its own (sometimes long) story 😉 1 u/segwhat Jan 19 '22 Hide some clutter on small screens.
yes but its still bad code nonetheless
1 u/twity1337 Jan 17 '22 True. Every piece of bad code has its own (sometimes long) story 😉
True. Every piece of bad code has its own (sometimes long) story 😉
Hide some clutter on small screens.
56
u/m3t4ldood Jan 16 '22
I'm guessing it's bad because you could just put all the Mediascreen functions in one thing instead of multiple
19
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jan 16 '22
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
9
u/NastroAzzurro Jan 16 '22
When back Enders write css. I’m surprised there aren’t any floats or absolute positioning here
1
u/twity1337 Jan 17 '22
Maybe just a beginner, who doesn't understand media-queries?