4 ms·
These are all really bad. But when my designer designs links as buttons and buttons as links, which am I supposed to use? Then there's the redesigning pages, la
by dsego 7y ago
These are all really bad. But when my designer designs links as buttons and buttons as links, which am I supposed to use? Then there's the redesigning pages, layouts and widgets every other week, based on our trackers and heat maps. How can I care about the quality of my html, when I know it's all gonna be scrapped next week or month when a new redesign comes in?
- echeese 7y agoIf it leads to a semantically different page, use <a>, if it's used only for javascript-interactivity use <button>. Never use <div> for buttons or links.
- dsego 7y agoIs adding role=button to <a> enough, or should I style a button to look like a link (.btn-link in bootstrap)? One issue with .btn-link is getting the vertical alignment to match any surrounding text.
- tabtab 7y agoIn practice the dichotomy between hyperlink and button is blurry and should be treated as blurry and interchangeable. But HTML doesn't really allow one to blur properly, at least not in all browser brands. To resolve this, it should be easier to make hyperlinks into buttons and buttons into hyperlinks. The difference should be aesthetics only. They are both a "span with an action". The action and styling (button versus hyperlink) should be attribute-based. Examples: <action type="post" look="link">Action 1</action> <action type="post" look="button">Action 2</action> <action type="link" look="button">Action 3</action> <action type="none" look="link" onclick="myJS()">Action 4</action>