我已经制作了一个按钮,但是对于我来说它还不够好,我希望当鼠标指针悬停在上面时,它的属性会发生变化。我尝试过:
a:hover #button {
text-decoration:underline;
}
以及:
a:hover input {
text-decoration:underline;
}
HTML:
<!DOCTYPE HTML>
<html>
<head>
<title>Sign-In</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type="text/javascript" src="script.js"></script>
</head>
<body id="body-color">
<h1 id="heading">Welcome to the Intarnet.</h1>
<hr style="color:#E6B636">
<div id="Sign-In">
<center><legend>Please enter your username and password.</legend></center>
<hr style="color:#E6B636">
<form method="POST" action="connectivity.php">
Username: <br><input type="text" name="user" size="40"><br>
Password: <br><input type="password" name="pass" size="40"><br><br>
<input id="button" type="submit" name="submit" value="Log-In">
</form>
</div>
</body>
</html>
-Trey
a
标签内是无效的,但您可以尝试使用a input:hover
。但是根据您的代码,在您的HTML中甚至没有a
标签。 - putvandeinput:hover
,你需要a
标签吗? - serakfalcona:hover
? - Fabrizio Calderan<center>
已被弃用,不应再使用。 - Paulie_D