Why <div><a></a></div> instead of <a><div></div></a>


#1

The way the course tells us to do it, we end up with a link inside a 'button' but really, buttons are clickable so why don't we put the div between the a tags so that the entire button is clickable?


#2

Which lesson is this?


#3

because when this course was written, html5 wasn't realized yet, and it was not recommend to nest a div in a a link. I personally won't do <a><div></div></a>, as explained in this stackoverflow question. I would do the following:

<a>cilck me</a>

and then css:

a {
  display: block;
  height: 50px
  width: 300px;
  background: aqua
}

turn the link into a block


#4

it is this exercise


#5

@kylanbb,
If i was on the look out for the solution to such a problem.....
i would do a google search
like
== discussions / opinions ==
why don't we put the div between the a tags so that the entire button is clickable? site:stackoverflow.com
and take it from there....


#6

WOW!!!!!!!!!!! a really nice question i to don't know the ans
:relaxed: