Comments on: Buttons vs. Links https://css-tricks.com/buttons-vs-links/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Tue, 02 Nov 2021 09:05:05 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Nicolas https://css-tricks.com/buttons-vs-links/#comment-1784910 Tue, 02 Nov 2021 09:05:05 +0000 https://css-tricks.com/?p=354978#comment-1784910 Something I was wondering because I often do it: what about opening modals/overlays (that have static content) with a <a href="#thiscontent">? Semantically, it is just a link to an other part of the content, even if it ends up looking like a button and “on-page interactivity” but that’s just appearances.

If Javascript is disabled, the modal can be displayed with CSS :target. If Javascript and CSS are not active, the page will nicely scroll to the content.

To me it makes a lot of sense but maybe there are aspects of it I’m not thinking of.

]]>
By: Nicolus https://css-tricks.com/buttons-vs-links/#comment-1784897 Tue, 02 Nov 2021 07:25:22 +0000 https://css-tricks.com/?p=354978#comment-1784897 I think what doesn’t help is that for years the de facto way of validating a form was to use a button. By definition a form sends you to another URL (specified in the “action” attribute) so by your rules it should really behave like a link, which is not how a good old html form behaves by default.

Funny thing is if you look at the very form I’m typing in to leave a comment on this page, it will send me to /wp-comments-post.php, and even though the “POST COMMENT” thing is not technically a link, it kind of behaves like one in that the cursor changes to the pointing finger on hover to indicate I’ll change page… So that’s OK I guess.

But now if I look at the “Write” and “Preview” things at the bottom of the textarea, well they should really be buttons because they won’t redirect me to a different page… And yet they’re good old <a> tags with the pointing finger cursor.

So yeah, my guess is we’ll still be discussing this years from now.

]]>