3 ms·
And that doesn't even get into CSS styling. You know a link starts with the exact same height and font that surrounds it, and then you can style it to predicta
by crazygringo 6y ago
And that doesn't even get into CSS styling.
You know a link starts with the exact same height and font that surrounds it, and then you can style it to predictably know exactly what you'll get.
A button shows up in a new font -- a font of unknown size at that, because it utterly ignores the font size of its container -- with extra height that introduces line-spacing issues -- and all of this by totally unpredictable amounts because it varies radically across both browser and platform. And if you want to undo all that styling, have fun delving into the quirks of each browser of how to do so.
If you're building something simple where appearance really doesn't matter, then sure throw in a button. But if you actually want to have predictable results, then the only straightforward way is with a link you style.
- mixmastamyk 6y agoButtons shouldn't be in the middle of a sentence or paragraph, so not sure how this applies.
- IggleSniggle 6y agoTake a look at the HN voting buttons. Or, better yet, the expand/collapse button for each comment thread. They are implemented as links, not buttons. Presumably, this makes it easier to align with the text that they are within.
- fiddlerwoaroof 6y agoHN isn’t a great example here, it’s still one of the last sites still using tables for layout.
- deleted 6y ago[deleted]
- rendall 6y agoAccording to whom?
- minitech 6y ago.button { all: unset; /* continue styling */ }
- crazygringo 6y agoHuh, TIL. Looking it up on MDN, looks like that was implemented in WebKit in 2016. Even HTML5 didn't have that, while <button> has been around since the late 1990's. Well, very happy to know that's no longer the case then, thanks! One more thing in CSS that's finally been addressed.
- fiddlerwoaroof 6y agoI really dislike this because it now makes the buttons not look like my platform’s buttons. I know this ship has sailed, but there are resets out there that allow you to fix most of the styling issues without making the buttons look like not-buttons.
- rendall 6y agoIt was possible to entirely reset the appearance of the button element before 2016.