Earlier quoted context omitted.
* { box-sizing: border-box; } I have never wanted anything other than this behaviour, so I pretty much always include it when starting on a fresh project.
Borders still affect the positioning of things even with box-sizing set to border-box. For example, here "Block 1" is still two pixels taller than "Block 2": Block 1 Block 2 https://jsfiddle.net/t4rkvfzx/
Write HTML Like It's 1999
81–90 of 191 posts
Re: Write HTML Like It's 1999
#82Which is perfectly fine advice if you aren't doing anything really novel. You probably don't need a custom library for dropdowns or forms or whatever else and would gain performance, accessibility, and stability by hooking into the native versions instead.
The one part I disagree with is necessarily using in place of divs with CSS Grid. The latter is native and is a perfectly legitimate replacement, with some added benefits like responsiveness.
Also the title is a bit of a misnomer, because lots of the HTML features that allow you to forego JavaScript are pretty recent:
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Fo...
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da...
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/In...
Re: Write HTML Like It's 1999
#83> To be clear, I’m not advocating for creating projects that look like they belong in the 1990s. Funny enough, only changing the body's background color to "lightgrey" and the font face to "serif" makes it look exactly like that.
Re: Write HTML Like It's 1999
#84Instead of a border I tend to have a debug helper that adds a 1px outline of cyan or pink. To get the “bones” of a component or page. Good advice. Definitely sounds like captain obvious but it’s also something I think needs to be said.
And for anyone who isn't familiar with (what I would consider) the most important difference in this use-case: borders affect the positioning of other elements, whereas outlines do not. You don't want to be using a temporary border, since it can significantly affect the layout of your site when you remove it.
Re: Write HTML Like It's 1999
#85Earlier quoted context omitted.
You can upgrade your browser but you can't upgrade to a body that isn't disabled (yet)
I agree. But I mean it in the sense that they are a very low % of users and you have to ponder if it makes sense to spend the money to support them.
Re: Write HTML Like It's 1999
#86Re: Write HTML Like It's 1999
#87Earlier quoted context omitted.
You can upgrade your browser but you can't upgrade to a body that isn't disabled (yet)
I agree. But I mean it in the sense that they are a very low % of users and you have to ponder if it makes sense to spend the money to support them.
Re: Write HTML Like It's 1999
#88Earlier quoted context omitted.
You can upgrade your browser but you can't upgrade to a body that isn't disabled (yet)
I agree. But I mean it in the sense that they are a very low % of users and you have to ponder if it makes sense to spend the money to support them.
Re: Write HTML Like It's 1999
#89Instead of a border I tend to have a debug helper that adds a 1px outline of cyan or pink. To get the “bones” of a component or page. Good advice. Definitely sounds like captain obvious but it’s also something I think needs to be said.
And for anyone who isn't familiar with (what I would consider) the most important difference in this use-case: borders affect the positioning of other elements, whereas outlines do not. You don't want to be using a temporary border, since it can significantly affect the layout of your site when you remove it.