Live data from Hacker News

Things I wish I’d known about CSS

cssfordesigners.com

211–220 of 340 posts

Re: Things I wish I’d known about CSS

#211
post #94

A little secret opinion of mine is that I think the global usage of rem instead of px is a fad. The only real argument I've heard is that the mobile devices have their own definition of it, and will thus optimize in their own way, but then again I see that benefit as being nearly non-existant and definitely not demonstrated.

The most relative units are calculated in turns of the font size of the root element (usually 1rem = 16px). I find it a lot easier to read and maintain units that are based on the font-size of the current element (e.g. `em`, `ex`, and `ch`). “This element has block margins 2 times the size of the font”, as opposed to some magic absolute `px` or `rem`. Also if margins and paddings are defined relative to the font-size (e.g `padding: 1ex 1em;`) resizing the entire element with `font-size` is way more manageable.

Re: Things I wish I’d known about CSS

#212

Earlier quoted context omitted.

To save clicks, it's $100, just covers page layouts.

That's a radically misleading comment. It covers much more than layout, and the free content on the site is incredibly helpful and compelling. The full version more than justifies its price. And they offer it for free to students or anyone else for whom the cost is a problem (relying on the honor system). It's far and away the best resource on CSS I've encountered in my 22-year career working with web technology for…

not that the free thing is relevant but from https://every-layout.dev/blog/you-pay/ "The honour system is now closed"

> That's a radically misleading comment. It covers much more than layout

Given the site and all 3rd party reviews just mention layout, how is it misleading? Cant find TOC anywhere?

Also, found working discount code 'BRANDEMIC' for 60% off in my travels should any1 bite the bullet.

prev hn sub/182 comments: https://news.ycombinator.com/item?id=20196061

Re: Things I wish I’d known about CSS

#213
post #126

It always helped me to do an absolute basic concepts course on a new technology I learn. Like, sure I can play around in Photoshop or Eclipse or CSS or JavaScript and find most things. But a good 101 course is worth so much saved time. Most of the stuff in that article was mentioned in a CSS box model course I did 10 years ago. People were always baffled how I learned all this. Well, I read the docs! They always assu…

Once I got the basic concepts of CSS I came to realize that of the trio of HTML, CSS, and JS (and SVG for that matter), CSS is the one you really miss when you have to make something using another system.

The amount of suffering I've endured in Latex, PDF, different native layout systems, or even React Native's slightly restricted version of CSS that would have been resolved by a stylesheet is immense.

Re: Things I wish I’d known about CSS

#214
post #156

Earlier quoted context omitted.

You seem to be trivializing css as something static you just have to deal with. This maybe true for 99% of websites but css has had more innovation in the last few years than anything else. And much of it hasn’t reached textbooks. For example css3 functions and now being able to mix these new techniques in undiscovered ways. CSS requires a very nimble and creative mindset. That maybe why backend devs usually are very…

Have you looked at Definitive CSS? It's up to date and a massive 1000 page tomb of encyclopedic knowledge and guidance. Anyone who digests that entire thing is not being dismissive of CSS. Digesting that is taking CSS more seriously than most people take learning new programming languages...which is appropriate! Because with CSS, you not only need to learn the language, you are effectively learning something like a l…

> Technically, you do have everything you need. And with a decade of work under your belt using those things, you can build some amazing and good robust systems. It's also easy to build total junk that nobody can understand but you.

This is what’s beautiful about the frontend. It’s “magic” and underneath in code speak it may be ugly but the work speaks for itself. Arguably that is only if you own it and maintain it.

> Lots of folks learn the language minimally, piecemeal, on an "as needed basis," and end up wasting a lot of time because they aren't aware of the larger features and how they can be fit together.

The way I see it, learning about all the ingredients in a recipe will not teach you how to cook. In css techniques are unearthed by a small handful of css artisans and it’s not about learning css itself in 99% of the cases. It’s about digging and finding the best ideas on GitHub, stack and codepen. And hacker news.

Re: Things I wish I’d known about CSS

#215
post #68

Earlier quoted context omitted.

I’ve written a small CSS ebook if that interests you. [1] It teaches you how to build a webpage from scratch. I’m currently writing my second one, which will be more theoretical and cover things like this blog post actually. I’d be interested to know what kind of problems you’re facing in CSS, so feel free to drop me an email. [1] https://jgthms.com/css-in-44-minutes-ebook/

I'm curious about your book, as it seems small enough for the kind of things I write as well [1]. Can I ask if it earns you enough for anything? Sorry for coming out of nowhere, but I have lots of small tutorials I could use (I teach in a local college) which I could make small ebooks out of them.. Looking for some side money.. [1] https://github.com/joaoventura/full-speed-python

I've been earning a bit on a regular basis since I published it 1 year and a half ago. Not enough for replacing a salary, but enough as side pocket money. I'm lucky to have a decent following, so I didn't have to market it a lot. I'm currently writing a second one which is longer and more advanced, so hopefully it will earn me a bit more.

Re: Things I wish I’d known about CSS

#217
post #55

Guys we need to talk. Are you capsbold serious? These are things that you learn in a first week of doing web development tutorials. I read this thread and it makes me think that I'm delusional because of a heat wave. Margins collapse? :focus exists? Me not getting a joke? I don't understand.

I think you are point on. The two existing sibling comments have contradictory excuses for this:

1. New developers might know this, but standards change fast, and it’s hard to keep up.

2. You can’t expect people new to the craft to know everything in the field.

I personally found this article sub-basic. You could probably learn more and better on MDN. I think CSS might be one of few areas on HN where a sub-par article doesn’t get the constructive scrutiny it deserves in the top comments.

Re: Things I wish I’d known about CSS

#218

I don’t thnk the author’s recommendation to include img { display: block; } in your reset is generally a good idea. It will break some common uses of images, for example to hold bits of math inline with the text when you are not using mathjax. If you want a displayed image, you should wrap it in a tag, which will give you a block element.

Yep, this stood out to me too. Drives me absolutely nuts when an element you expect to be inline is now suddenly block.

Especially because the author's reasoning is "it can cause confusion when trying to position them or add vertical margins", after just explaining that with inline-block "you can apply vertical margins to these".

Re: Things I wish I’d known about CSS

#219
post #17

Useful article. Getting started with CSS must be harder these days than it was 15-20 years ago. Not only for mobile-friendliness, but also because of the coexistence of flexbox/grid/traditional layouts. I'm wondering if the standard will ever been simplified, instead of being added more and more features.

“Getting started with CSS must be harder these days than it was 15-20 years ago.” Not like I’m teaching anyone these days, but I’m not sure about that. Yes, there’s just more now. Grid and flexbox and transforms and on and on. But if you were totally starting from scratch, certain stuff is just way easier now, or at least, not a pile of hacks upon hacks. Basic beginner stuff that comes to mind… • How can I center som…

The whole float-based layout thing was a hack. Floats make perfect sense if you only ever use them as floats: box-outs to run text around.

The fact you could use them to build all sorts of header/column/footer layouts was both very helpful and entirely confusing.

It became the default way to use CSS, for good reason. Yet, I always felt it was a shame it wasn’t often described as the hack it was.

Re: Things I wish I’d known about CSS

#220
post #215

Earlier quoted context omitted.

I'm curious about your book, as it seems small enough for the kind of things I write as well [1]. Can I ask if it earns you enough for anything? Sorry for coming out of nowhere, but I have lots of small tutorials I could use (I teach in a local college) which I could make small ebooks out of them.. Looking for some side money.. [1] https://github.com/joaoventura/full-speed-python

I've been earning a bit on a regular basis since I published it 1 year and a half ago. Not enough for replacing a salary, but enough as side pocket money. I'm lucky to have a decent following, so I didn't have to market it a lot. I'm currently writing a second one which is longer and more advanced, so hopefully it will earn me a bit more.

Thanks for the reply! Do you have any practical tips you may want to share? Maybe how did you grow your audience, how you wrote your book (technologies, etc.)?
Post reply on HN