Live data from Hacker News

Why is CSS the way it is?

increment.com

1–10 of 173 posts

Re: Why is CSS the way it is?

#5
I have a weird relationship regarding CSS:

I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site.

I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompatibilities of different browsers, but with CSS3 I was sold, even more so when grid based layouts and flexbox became a thing one could lean on.

The one thing that I miss is a little bit more power when it comes to selectors. E.g. there is no way to select a

which has only a as a child, which is coincidentally something that a standard conform markdown to HTML converter will produce. So you cannot — say give your

a max-width of 120ch without also limiting the width of the contained within it. AFAIK there is a parent selector planned that might address this if I recall correctly.

Re: Why is CSS the way it is?

#6
post #5

I have a weird relationship regarding CSS: I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site. I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompat…

You can't work out the logical consequences of seemingly obvious properties. That is unlike 95% of most programming I do in any programming language I've ever used. Since I have zero interest in learning unintuitive interfaces to GUI design, I have zero interesting in excusing CSS. It is not difficult to learn, it is not difficult to understand in terms of conceptual understanding, it is downright tedious to learn though - and you don't get anything unique out of it that can't be done in anything else: you get a nice looking website. Amazing.

Re: Why is CSS the way it is?

#7
post #5

I have a weird relationship regarding CSS: I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site. I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompat…

https://css-tricks.com/almanac/selectors/o/only-child/

The :only-child pseudo-class selector property in CSS represents an element that has a parent element and whose parent element has no other element children.

on edit: sorry I got confused and dropped your requirement to select the parent.

Re: Why is CSS the way it is?

#8
post #5

I have a weird relationship regarding CSS: I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site. I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompat…

https://css-tricks.com/almanac/selectors/o/only-child/ The :only-child pseudo-class selector property in CSS represents an element that has a parent element and whose parent element has no other element children. on edit: sorry I got confused and dropped your requirement to select the parent.

Yes but you cannot select the parent p which is what they were talking about.

Re: Why is CSS the way it is?

#9
post #5

I have a weird relationship regarding CSS: I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site. I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompat…

You can't work out the logical consequences of seemingly obvious properties. That is unlike 95% of most programming I do in any programming language I've ever used. Since I have zero interest in learning unintuitive interfaces to GUI design, I have zero interesting in excusing CSS. It is not difficult to learn, it is not difficult to understand in terms of conceptual understanding, it is downright tedious to learn th…

> You can't work out the logical consequences of seemingly obvious properties.

Could you expand on this a little / give an example?

Re: Why is CSS the way it is?

#10
post #5

I have a weird relationship regarding CSS: I kinda like it (although some things could be even a bit more powerful), yet everybody I meet tells me how horrible and hard etc it is. I never had that feeling at all, not even back when I started using it as a teenager to customise my MySpace site. I cursed at how hard common things like centering a image within a div were, I cursed at the purposeful and ignorant incompat…

You can't work out the logical consequences of seemingly obvious properties. That is unlike 95% of most programming I do in any programming language I've ever used. Since I have zero interest in learning unintuitive interfaces to GUI design, I have zero interesting in excusing CSS. It is not difficult to learn, it is not difficult to understand in terms of conceptual understanding, it is downright tedious to learn th…

> it is not difficult to understand in terms of conceptual understanding

So what is your point? What you lack is motivation to make things pretty so it's not CSS's fault :)

Post reply on HN