Home > Article > Web Front-end > How to add hyperlink to button in css
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.
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('url地址')">
e897951a19c5631754268a1fd87bf893
2. If you need to open a new page for redirection, use:
<input type="button" onclick="window.open('url')">
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!