5.6 Can't press the button


#1

Hello ,
after completing 5.6 tasks I wasn't able to use the button itself only the hypertext inside of it. How do I actually use the whole area of the button as a hyper-portal?


#2

Hey @blogsolver52718 just paste your code so we can help you! :smile:


#3

I think you need to make the entire div a link (using the a command) not only the text inside it.


#4
<div> <a href = "google.com"> google </a>
		
	</div>

#5

Try:

a href="googl.com">
div>
style your button
and write something on it with you want
/div>
/a>


#6

Hi,

You can make like @mrcht says:

<a href="google.com">
  <div id="button"> Some text here </div>
</a>

... but, if you do this the hole line, from left to right will be seen as a link, because div is an block-level element.
I made a little example for you here.


#7

thank you so much! now the whole button is active. The confusion comes from the assigment where it's stated that goes inside div's not the opposite


#8

but if you do this, you will only make the text clickable. The problem here is that when the exercise was written, html5 wasn't realized, it was not recommend to nest a div in a link. Now you can do that, back then you couldn't, you could display the link as a block:

a { display: block; width: 300px; height: 100px; background-color: aqua; }

so that is why the exercise is the way it is, standards change quickly, and codecademy mostly made new course, and updated little of the old course (don't worry, everything in the exercise is still valid, there are just more new possibilities)