this post was submitted on 26 Mar 2024
247 points (94.6% liked)

Programmer Humor

32710 readers
394 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
247
CSS Humor (self.programmerhumor)
submitted 9 months ago by YoorWeb to c/[email protected]
 

top 16 comments
sorted by: hot top controversial new old
[–] [email protected] 43 points 9 months ago (2 children)

I refuse to believe that's CSS. What is that colon at the end even?

[–] [email protected] 31 points 9 months ago (1 children)

It’s a typo. The colon should be a semicolon. But since it’s the last declaration, it’s optional.

[–] hibsen 18 points 9 months ago (2 children)

I don't think bottom is a valid value for the position property either.

[–] [email protected] 26 points 9 months ago (1 children)

Yep, and align isn’t a real property, either.

[–] hibsen 10 points 9 months ago

How deep does this rabbit-hole go?!

[–] [email protected] 6 points 9 months ago

And yet someone on the internet would unsarcastically comment that just adding flex-box would fix it.

[–] micka190 10 points 9 months ago

It'll just get ignored. I saw a fucking padding: 0.0.3rem at work today, and it just broke the one class.

[–] desmosthenes 27 points 9 months ago (1 children)

came to hate on this code; it’s not valid lol

[–] YoorWeb 2 points 8 months ago (1 children)
[–] desmosthenes 1 points 8 months ago
[–] captainjaneway 25 points 9 months ago* (last edited 9 months ago) (1 children)
#moustache {
  position: absolute;
  bottom: 10px;
  margin: 0 auto;
}

If that doesn't work:

#moustache {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

Relative positioning is preferred but not always available if the parent face is positioned absolutely.

Edit: adjusted bottom from 0 -> 10px since 0 would be at the bottom of the chin but there is obviously some padding to bring it nearer the lip

[–] ensignrolaren 3 points 9 months ago

I came here to post this and I wouldn’t have clogged up the thread with this useless comment except for your username. I salute you

[–] [email protected] 20 points 9 months ago* (last edited 9 months ago)

Moustache seems generic for an id, maybe you meant to apply as .moustache? Let's keep things consistent please

Edit: center also seems unnecessary, in the beta moustaches are already aligned as a child of .facial-hair

[–] [email protected] 4 points 9 months ago

Hahaha. First true boisterous laugh of the day. Thanks!

[–] hakunawazo 3 points 9 months ago

Just use JS and get X Y position of nose and put it a few pixel below. So it would be still valid if the nose moves.

[–] [email protected] 1 points 9 months ago