Leandra Hartmann
Leandra Hartmann

Reputation: 1

Mozilla cannot read my button with "href"

I created my portfolio but unfortunately I cannot use a button properly. What did I wrong?

On Chrome it does work pretty well!

friendly regard

<button><a href="portfolio.html">Check Portfolio</a></button>

Upvotes: 0

Views: 43

Answers (2)

SomeShinyObject
SomeShinyObject

Reputation: 7811

The proper method to implement this is to stick the button inside of a form with method="get" and an action attribute with the site you are linking to.

You can also use JavaScript to set an event handler on the click event of the button.

Also, you can use CSS to make an anchor tag look like a button.

The one route NOT to go is wrapping a button in an a or vice-versa. It's not proper HTML.

Upvotes: 2

drtechno
drtechno

Reputation: 323

if you use an A tag, you stick the button inside it also, you should use the full url, unless its in the current directory the webpage is in. For example:

 <a href="https://www.google.com"><button> Click Here to Google! </button></a>

Upvotes: 0

Related Questions