6 Years
Discussion Span
Last Post by Troy III

Divs are containers (usually for styling and such), anchors are links.
Usually you'd place links and such within a defined container, not the other way around.
What kind of practical application are you thinking? Because a link is usually not more than words, or a picture.


Illustratively, and in a real world:

it's as if you're trying to insert a matchbox in a stick, instead of the other way around; which is sane and you just might succeed in doing so.

In virtual world 'physical properties' of 'things' are not that rigid. But there are reasons you shouldn't do it.

One of the reasons is that an anchor / link element -is an inline element, (marker), -while div's are block elements, (containers)

because you don't have to wrap a div in it for it to be able to link you to some other content

especially not, -to make it an anchor element (so that a proper link could navigate you [directly] to that div content)

most importantly it adds confusion to the DOM Tree mirror.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.