Home  >  Article  >  Web Front-end  >  How to add hyperlink to button in css

How to add hyperlink to button in css

藏色散人
藏色散人Original
2021-01-05 10:00:597494browse

How to add a hyperlink to a button using css: 1. Use the "window.location.href('url address')" method to redirect this page to a new page; 2. Use "window.open(' url')" method to open a new page.

How to add hyperlink to button in css

The operating environment of this tutorial: windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Related recommendations: "css video tutorial"

html/css Add hyperlink to button

You can use HTML onclick event attribute

1. If you want this page to redirect to a new page, use:

<input type="button" onclick="window.location.href(&#39;url地址&#39;)">

e897951a19c5631754268a1fd87bf893

2. If you need to open a new page for redirection, use:

<input type="button" onclick="window.open(&#39;url&#39;)">

3. If you need to return to the last opened page, Then use:

<input type="button" onclick="window.history.back()">

The above is the detailed content of How to add hyperlink to button in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn