悬停不适用于按钮元素

时间:2018-04-24 14:55:08

标签: css html5 hover

希望这很容易解决,但我一直试图寻找答案,似乎没什么好看的。

我正在尝试对按钮进行悬停效果:

button {
min-width: 20vw;
max-width: 40vw;
border: none;
color: white;
font-size: 1.5vw;
padding: 15px 32px;
text-align: center;
text-decoration: none;
background-color: blue;
border-radius: 20px;
transition: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button:hover {
color: black;
background-color: lightcyan;
}

当我在浏览器中测试它时(vivaldi& edge)没有任何变化。顺便说一下,测试网站是http://wyrdling.com/skulpturjagt

PS。我尝试使用chrome开发工具,但是我太过于想知道如何阅读XD

2 个答案:

答案 0 :(得分:1)

除非你的问题是拼写错误,否则你使用if (c.Length > 1) { int b; int d; bool result = Int32.TryParse(c[0], out b); bool result1 = Int32.TryParse(c[1], out d); if (result && result1) { if (b < 200) { //Do Something!!! } } else { //Do Whatever you wanted to do when the data was incorrect Console.WriteLine("Attempted conversion of '{0}' failed.", value == null ? "<null>" : value); } } else { //Input from socket comms was not of the correct input!!! } 。这适用于类.button:hover的元素。将其交换为hover

答案 1 :(得分:0)

以下是一些示例掠夺者。

示例1:

&#13;
&#13;
button {
min-width: 20vw;
max-width: 40vw;
border: none;
color: white;
font-size: 1.5vw;
padding: 15px 32px;
text-align: center;
text-decoration: none;
background-color: blue;
border-radius: 20px;
transition: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
button:hover {
color: black;
background-color: lightcyan;
}
&#13;
<button>My button.</button>
&#13;
&#13;
&#13;

示例2:

&#13;
&#13;
.button {
min-width: 20vw;
max-width: 40vw;
border: none;
color: white;
font-size: 1.5vw;
padding: 15px 32px;
text-align: center;
text-decoration: none;
background-color: blue;
border-radius: 20px;
transition: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button:hover {
color: black;
background-color: lightcyan;
}
&#13;
<button class="button">My button</button>
&#13;
&#13;
&#13;