首頁  >  問答  >  主體

從提交和重置按鈕中刪除懸停效果:逐步指南

當我點擊「提交」或「重置」按鈕時,我需要使用什麼命令才能使其不縮放。我希望他們看起來很正常。我應該對這個程式使用懸停,但不能對最後 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 天前340

全部回覆(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
  • 取消回覆