Earlier quoted context omitted.
> 15. .webp: significantly overrated, in my opinion. It doesn’t give anywhere near as big a boost in compression relative to properly-done JPEG as people think (like under 10% a lot of the time). Now AVIF, that’s another matter. I was saying the same thing but then I realized something. The thing about webp isn't about how it compares to jpg[0]. Png on the other hand, with all those logos and some with transparency.…
Try https://tinypng.com/ for png compression.
HTML Tips (2020)
81–90 of 136 posts
Re: HTML Tips (2020)
#82Re: HTML Tips (2020)
#83Earlier quoted context omitted.
There's so much stuff in HTML that's almost good enough to replace things we use Javascript for. We should also have had built-in pagination and sorting on tables, like, years ago, with some kind of (optional, if your data aren't all available on the initial page load) back-end spec for how the requests will be shaped and for delivering the data. An awful lot of "AJAX" Javascript use could just be frames and iframes,…
In Python there's a saying: the standard library is where modules go to die. That effect applies even more so for browser builtins. IMO we would be better off moving most of these things out of the browsers and into some kind of web component standard.
Re: HTML Tips (2020)
#84No mention of the element [1] but that's probably because browser support isn't great—not implemented in Safari, experimental flag in Firefox. The lazy-loading option for img elements is news to me, but I think I'd still prefer to use JavaScript for that task. Same probably goes for the dialog element actually now that I think about it. Having a simple HTML5 option might seem cool, but I like to keep the actual logic…
Re: HTML Tips (2020)
#85Does lazy loading at least carve out a placeholder spot for the image so that it doesn't throw off the layout? Because if not, please use something that does. There's nothing more frustrating than when I'm trying to read through a page and my spot keeps getting pushed up and up because of dynamically loading elements.
It used to not work for responsive images. We had to do tricks like pseudo elements with padding set to a percent value: https://css-tricks.com/preventing-content-reflow-from-lazy-l...
Re: HTML Tips (2020)
#86Awesome list! The ' tip reminds me that I wish there was a better way to do nested list numbering of the kind you'd likely find in a table of contents, such as "1.1.2" and so on. As far as I'm aware there's no simple way to do this natively without using CSS or JS to change the list item prefix.
You can do that with CSS alone. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_a...
Re: HTML Tips (2020)
#87Awesome list! The ' tip reminds me that I wish there was a better way to do nested list numbering of the kind you'd likely find in a table of contents, such as "1.1.2" and so on. As far as I'm aware there's no simple way to do this natively without using CSS or JS to change the list item prefix.
Hum... Are you referring to the numbers that appear when you nest lists? As in putting an ol inside an item of another ol?
Re: HTML Tips (2020)
#88Wow, I had no clue that these existed, and I am a front-end developer!
Frontend devs not knowing HTML, but having complicated and over engineered build pipelines and continous integration for their JS cruft.
I wonder why sites don't load faster or render... ah right Javascript in the mega bytes.
Re: HTML Tips (2020)
#89No mention of the element [1] but that's probably because browser support isn't great—not implemented in Safari, experimental flag in Firefox. The lazy-loading option for img elements is news to me, but I think I'd still prefer to use JavaScript for that task. Same probably goes for the dialog element actually now that I think about it. Having a simple HTML5 option might seem cool, but I like to keep the actual logic…
There is a polyfill that makes it works even on IE.
I embraced and use it on a product that it's remaking&modernizing all the frontend. Sadly, when I take the decision a few years ago, I thought that would be supported for all browsers, but looks that adoption has been paralyzed.
Re: HTML Tips (2020)
#90Earlier quoted context omitted.
There's so much stuff in HTML that's almost good enough to replace things we use Javascript for. We should also have had built-in pagination and sorting on tables, like, years ago, with some kind of (optional, if your data aren't all available on the initial page load) back-end spec for how the requests will be shaped and for delivering the data. An awful lot of "AJAX" Javascript use could just be frames and iframes,…
> Form validation should be built-in Have you used pattern attributes? https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes...