首页  >  问答  >  正文

从提交和重置按钮中删除悬停效果:分步指南

当我单击“提交”或“重置”按钮时,我需要使用什么命令才能使其不缩放。我希望他们看起来很正常。我应该对这个程序使用悬停,但不能对最后 2 个按钮使用悬停

请参阅下面我到目前为止所拥有的代码。任何事情都值得赞赏

<!DOCTYPE html>
<html>
<head>
    <title>CSS rules</title>

    <style>
input:focus{
    background-color: yellow;
    height: 40px;
    width: 280px;
    color: blue;
    font-size: 24px;
}
input:hover{
    background-color: cyan;
    height: 40px;
    width: 280px;
    color: red;
    font-size: 24px;
}
</style>
</head>

<body>

    <form action="">

        <table>
            <tr>
                <td>Last Name:</td>
                <td>
                    <input type="text" id="LastName" />
                </td>
            </tr>

            <tr>
                <td>First Name:</td>
                <td>
                    <input type="text" id="FirstName"/>
                </td>
            </tr>

            <tr>
                <td>E-mail Address :</td>
                <td>
                    <input type="password" id="Email"/>
                </td>
            </tr>

            <tr>
                <td>
                    <input type="submit"/>
                </td>

                <td>
                    <input type="reset"/>
                </td>
            </tr>
        </table>

    </form>
</body>
<!--body tag ends here-->
</html>
<!--html tag ends here-->

尝试使用代码,但我无法弄清楚

P粉099000044P粉099000044181 天前341

全部回复(1)我来回复

  • P粉037450467

    P粉0374504672024-04-02 00:52:36

    
    
    
        CSS rules
    
        
    
    
    
    
        
    Last Name:
    First Name:
    E-mail Address :

    更改了调用样式的方式。通过在 CSS 中传递 [type=text],您可以确保只有 type=text 和 type=password 拾取样式,并使提交和重置按钮不拾取样式。

    回复
    0
  • 取消回复