I do think the anchor tags are in general more versatile. You can even turn an entire div container (including its children) into a clickable object with styling. I must just remember that if I want to align one of these "buttons", I must use "text-align" instead of something like "justify-content", because that div container would technically be classed as text, which is funny. I discovered this by accident when I was hand coding my business website.
@chris9soulАй бұрын
It's so much about being a clickable element as it is about accessibility. Buttons are for actions, links are for navigation. Also, if you're turning an entire card into a link, that will be an issue for screen readers, as they will read all the content of the link, including image alt text, as one sentence! I have an example of how we can fix that here: socks-ui.webflow.io/components/card
@Jay-pj7obАй бұрын
Even most of the component libraries comes with "link" variant to their button component.
@chris9soulАй бұрын
The styling doesn't matter. What matters is the function. If it goes to a page, it should be a link. If it does an action, it should be a button. Links go, buttons do.
@wibletonhaАй бұрын
Where to add the URL / Choose page to link to if you use a Custom element with 'button' tag?
@chris9soulАй бұрын
Buttons are not used for navigation! Use a link block