Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think wrapping a div with an <a> element is now valid, you probably want to only wrap inline elements like a <span> with an <a> when possible. Imo it's a better practice.

It also avoids having large "white space" areas that are clickable, when only the text should be clickable. (Like when you wrap an <h1> with an <a> for example.)



The original comment describes this issue with buttons, where presumably clicking the non-text portion of a button is a feature, not a bug.


To add on, clickable whitespace is more of a feature than a bug generally now, because at least in mobile-web world the worst possible thing you could do is make your touch target extremely small by making it only the icon rather than a standard touch target size centered on said icon.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: