欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
答:使用提交按钮
如果您没有选择使用<a>元素的选项,则可以<form>在动作属性的值设置为所需URL的位置使用提交按钮。
 
让我们尝试以下示例以了解其基本工作原理:
 
例试试这个代码»
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Make HTML Button Act Like a Link</title>
<style>
    form {
        /* To keep the form in flow with the surrounding text */
        display: inline;
    }
</style>
</head>
<body>
    <form action="https://www.google.com/">
        <input type="submit" value="Go to Google">
    </form>
</body>
</html>

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h61128.shtml