gpt4 book ai didi

html - href 围绕输入类型提交

转载 作者:太空狗 更新时间:2023-10-29 13:33:52 24 4
gpt4 key购买 nike

为什么围绕输入类型提交的 href 在 IE 中不起作用? (我能做些什么来修复它)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org    /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen">
</head>
<body>
<a href="1.html"><input type="submit" class="button_active" value="1"></a>
<a href="2.html"><input type="submit" class="button" value="2"></a>
<a href="3.html"><input type="submit" class="button" value="3"></a>
</body>
</html>

样式.css:

* {
margin: 0;
padding: 0;
}

/* CSS Buttons: http://www.web4site.de/css/css-buttons.php */
.button {
padding:0;
margin:0;
border:none;
font-size:14px;
background: url(../img/button.gif) no-repeat center;
color: #000000;
height:27px;
width:134px;
font-variant:small-caps;
}

.button:hover {
padding:0;
margin:0;
border:none;
font-size:14px;
background: url(../img/button.gif) no-repeat center;
color: #FF0000;
height:27px;
width:134px;
text-decoration:none;
font-variant:small-caps;
}

.button_active {
padding:0;
margin:0;
border:none;
font-size:14px;
background: url(../img/button.gif) no-repeat center;
color: #FF0000;
height:27px;
width:134px;
font-variant:small-caps;
}

这在 firefox 中工作正常......

最佳答案

为什么要将提交按钮放在 anchor 内?您正在尝试提交表单或转到其他页面。哪一个?

要么提交表单:

<input type="submit" class="button_active" value="1" />

或者转到另一个页面:

<input type="button" class="button_active" onclick="location.href='1.html';" />

关于html - href 围绕输入类型提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6693566/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com