sara_jessica Posted November 23, 2020 Report Share Posted November 23, 2020 hi, i 'm learning html recently and i've taught that inline elments can't hold block elements (flow content), but when i tried a <div> tag nested in <a> tag , in w3c validator didn't recognize it like in error, why? Link to comment Share on other sites More sharing options...
Ingolme Posted November 24, 2020 Report Share Posted November 24, 2020 HTML started allowing nesting blocks inside <a> elements when it transitioned to version 5 because there are so many use cases for hyperlink blocks. I still just set the display of <a> elements to "block" with CSS to avoid an unnecessary <div> inside it unless the structure is complicated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now