r/ProgrammerHumor • u/splatterghost Spanish is turing complete • Dec 16 '18
The pains of CSS
714
u/Ree-yo Dec 16 '18
Looks like the nose was set to absolute positioning
0
Dec 16 '18
[deleted]
101
u/DownshiftedRare Dec 17 '18
"This is the solution if you are using bootstrap but I have no fucking clue what to do if you're not"
33
u/diamondburned Dec 17 '18
"You could easily do this with jQuery"
$.whatever_obscure_function()→ More replies (1)17
Dec 17 '18
Worst is when you ask something to be solved in Javascript and solutions are in jQuery or ask you to use some JS library to that work for you. Like WTF.
27
11
u/joe_pel Dec 17 '18
the irony being, if you don't use bootstrap you have to really fucking pull yourself up by your bootstraps.
371
u/Slavadir Dec 16 '18
Aww he looks kinda happy now
509
23
2
u/DontTalkToMeOrMyself Dec 17 '18
Yeah but the red on his cheeks became his hands. There's nothing right about this
72
u/Telvanis Dec 16 '18
*my word document when insertig an image*
10
304
u/RockleyBob Dec 16 '18
My initial intuition about what any given line of CSS will do is dead wrong. 100% of the time.
114
30
Dec 16 '18
*{ box-sizing: border-box; }
15
u/Peechez Dec 17 '18
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }if we're gonna go there
13
u/RYJASM Dec 17 '18 edited Dec 17 '18
%border_box { box-sizing: border-box; } %inherit__border_box { box-sizing: inherit; } html { @extend %border_box; } * { @extend %inherit__border_box; &:before, &:after { @extend %inherit__border_box; } }We can go deeper.
10
100
u/AndrewIsANerd Dec 16 '18
W3schools knows what they all do, so therefore I do too if someone asks
→ More replies (2)36
21
u/Zmodem Dec 16 '18
You'll really love how DOM reordering occurs when a parent's opacity is changed and the children fall behind elements, even if their z-index and relative parent are properly set.
→ More replies (1)42
39
u/break_rusty_run_cage Dec 16 '18
My initial intuition about what any given line of CSS will do is dead wrong.
100%Auto of the time.FTFY
(Don't kill me. I'm no programmer)
→ More replies (1)37
Dec 16 '18
body {
background-color: white;}
Entire website gets shrunk into the corner, and the background color is somehow not even white
39
23
593
u/T4O2M0 Dec 16 '18
64
u/kerohazel Dec 16 '18
It's ok if you don't consider CSS a programming language. I don't. But a lot of real programmers still have to deal with it.
→ More replies (16)81
u/Adawesome_ Dec 16 '18
Curious, how is this gatekeeping?
114
u/MrHandsomePixel Dec 16 '18
There is this running joke around the community that CSS isn't a programming langugage.
Although HTML and CSS can technically be turing complete (quick google search, didn't even know), the main function of CSS is in its name: Cascading Style Sheets To add style to stuff
88
27
u/bobo9234502 Dec 16 '18
How can HTML be Turing complete? Honest question.
52
u/SandyDelights Dec 16 '18
It isn’t. HTML5 needs CSS3 to be Turing complete. So it’s a bit misleading.
27
u/SandyDelights Dec 16 '18
Just to be bit-picky, neither HTML nor CSS are Turing complete – using both HTML5 and CSS3 together can be considered Turing complete, though. Neither is a Turing complete language on its own.
→ More replies (2)213
u/ArcaneYoyo Dec 16 '18
CSS doesn't really have logic, it's purpose is just to structure things and style them.
37
u/aloofloofah Dec 16 '18
SQL isn't Turing complete either but nobody thinks that Bobby Tables doesn't belong here.
→ More replies (5)196
u/abbott_costello Dec 16 '18
Its still programming adjacent, most programmers know what CSS is while most non-programmers don’t know what CSS is. Saying it doesn’t belong on the sub is just pedantic
71
→ More replies (8)37
u/HankMoodyMaddafakaaa Dec 16 '18
Yeah it’s not programming, but it is coding. And it is pretty important since it’s used in pretty much any website on the internet.
→ More replies (2)10
7
→ More replies (3)34
56
→ More replies (3)14
→ More replies (10)136
Dec 16 '18 edited Dec 16 '18
The sub is programmerhumor, not programminghumor, not serversidehumor.
Never underestimate a STEM nerd to not be an elitist fuckass.
15
→ More replies (127)7
Dec 16 '18
Jesus, calm down. They even said the word 'gatekeeping'. It was a little joke.
→ More replies (1)
18
11
11
10
Dec 16 '18 edited Dec 17 '18
I wonder if it's because no one really tries to learn CSS properly. At least in my experience I picked up enough html/css to get started but only really focused on getting better at JS and CSS is mostly an after thought. Most of the time I'm dealing with a framework like Bootstrap or Materialize and just edit those.
So I wonder if it's actually a pain in the ass or i just haven't learned it properly. Probably both.
EDIT: I take it back, I just remembered IE. Fuck CSS. At least JS had jQuery were I didn't have to write too much browser specific code.
EDIT2: It's probably more IE's fault than CSS, I'm sorry CSS.
12
Dec 16 '18
I see this way too much. A lot of people don’t know CSS well. They either think it’s completely broken or it’s not “programming” and don’t bother to really look into it. CSS positioning is not that complicated. Yes, it’s weird to wrap your head around at first but after reading up about it and playing around with it, you should know how it works. Not to mention Flex has made everything easier.
It does become a pain in the ass when you have to make it responsive on all browsers and devices. A lot of tweaks to be done. And of course, if you want to do really fancy frontend stuff, you will have to put more effort in.
→ More replies (4)→ More replies (2)2
u/SuperSatanOverdrive Dec 16 '18
I don’t think it’s that much of a pain (usually). Especially since there’s many great frameworks to get you started. And while you before had to have a framework to get stuff like responsive grids, now you can use native functionality like flex to achieve the same result.
The pain comes if you’re forced to implement something which really should be in the standard. Like, for instance statically positioned headings in a table that has an auto width.
9
u/crsuperman34 Dec 17 '18
Am CSS/SCSS/Front-End dev, I've been wanting to build an entire site only using pseudo selectors...
and then paying a professional shop to do some work on it. Just to get the reaction.
2
8
36
39
7
8
u/fuck_the_mods Dec 16 '18
Last week I added overflow: auto to an element and it broke z-index on iOS. W T F
2
u/killm_good Dec 16 '18
Chrome on Android interprets hex colors with <FF alpha to be fully transparent.
rgba()is fine though.→ More replies (1)2
u/Omega192 Dec 17 '18
Somehow mobile Safari has bugs desktop Safari doesn't. It's up there with IE in terms of causing me immense frustration.
4
4
3
3
3
3
3
3
3
Dec 17 '18
So true..there should be multiple versions of that Pikachu image depicting different browsers, too
3
10
u/Andy_B_Goode Dec 16 '18
I have never understood why CSS has remained so popular as a way of positioning things in a browser viewport. It's bizarre to me that in this day-and-age, after years of single-page web apps, browsers haven't implemented some alternative to CSS that better suits app-like websites instead of page-like websites. I know there are workarounds, but they basically amount to writing code that then gets transformed into CSS for browser consumption. Why can't we have a native alternative? Why do I keep having to use a system that's essentially meant for aligning chapter headings on a page, when what I'm really doing is positioning a popup dialog relative to where the user clicked?
0
5
2
u/MasonXD Dec 16 '18
As someone who just made a Pokémon themed website for University this is very literal to me
2
2
2
Dec 16 '18
Is the programming job market so flooded that this sub reaches the front page everyday?
→ More replies (4)
2
2
u/VoldemortsHorcrux Dec 17 '18
My go to way of modifying css after 3 years is still make some changes in chrome dev tools and see what changed. And after 10 minutes of that google it. All the specifics never stuck with me.
2
u/ow2330 Dec 18 '18
It’s not just painful with css, it’s fucking hell with css when you include animation, transition and transformation
2
2
1
1
1
1
1
1
1
1
1
u/DataBound Dec 16 '18
Then you open it in a different version of the same browser or different browser altogether.
1
u/ionxeph Dec 16 '18
the worst CSS bug I had to fix once was on a page with 6 levels of different items that overlay on top of each other (there were modal dialogue pop ups, menu pop ups, sub menu of sub menus, and various hover or on-click tooltips)
z-index of everything was all over the place, the eventual fix resulted in 1 specific div whose z-index is now 101000
1
1
1
1
1
1
u/Coconut_Biscuits Dec 16 '18
Random guy from /r/all here. What does CSS stand for? I know it's a programming language but whenever I see it, I read it as Counter Strike Source
5
Dec 16 '18
It’s Cascading Style Sheets. The reason for why everything on a website looks nice and right on the screen. Without CSS, it would look a random text file.
→ More replies (2)
1
u/craftsmany Dec 16 '18
Psst Can I tell you something creepy?
Horizontal and vertical centering
→ More replies (1)
1
u/iapetus-11 Dec 16 '18
Yess, at first when I was coding I thought you had to put it in every page every time instead of in one .css file
1
u/Codephluegl Dec 16 '18
A line of CSS that saved my ass countless of times, when trying to debug weird issues with floats:
* { outline: 1px solid red !important; }→ More replies (1)
1
1
1
1
1
1
1
u/crsuperman34 Dec 17 '18 edited Dec 17 '18
on your
<body>tag putstyle="{ box-sizing: content-box!important;}"
then in the first line of your css put:body { box-sizing: border-box }body > * { display:inline }design your site so it looks ok,
send it to your dev friend, ask them to fix something.
watch them cry.
1
1
1
u/trialander Dec 17 '18
Doing a school project, trying to put images as the asides. It ends up EXACTLY like this, lmao.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/SupremeRedditBot Dec 17 '18
Congrats for reaching r/all/top/ (of the day, top 25) with your post!
I am a bot, probably quite annoying, I mean no harm ^though
Message me to add your account or subreddit to my ^blacklist
1
1
1
1
u/LinAGKar Dec 18 '18
I designed a web page recently and it wasn't so bad. Though I'm not sure how I would have done it without flexbox.
1
u/BlackAccipiter Dec 20 '18
Well... That's fucked up. Let me fix this! (And goes to make more codes in CSS and adds JS codes)
(Gets more fucked up) NOOOOOO
1
1
1
u/Piece_Of_Mind1983 Nov 25 '21
As someone with about an hour’s worth of experience with css this is far too accurate.
2.9k
u/RedZaturn Dec 16 '18
Sure you have tried to use CSS but have you ever designed a website in Microsoft word?