簡體   English   中英

為什么顏色和背景顏色標簽在我的 CSS 代碼中不起作用?

[英]Why aren't the color and background-color tags working in my CSS code?

我正在設計一個具有粉紅色背景和深粉紅色標題文本的表單。 我的 CSS 的 rest 似乎工作正常,只是顏色標簽不工作。 這是我的代碼:

<!DOCTYPE html>
<html>
<head>  
    <style>
        body{
           background-color: "#E6E6FA";
        }
        h1{
            color:"#800080";
            font-family:cursive;
            text-align:center;
            
        }
        td#curricularActivity{
           background-color:"#00FFFF";
        }
    </style>
</head>

<body>
    <h1>MONTHLY EXPENSES CALCULATOR</h1>
    <form onsubmit="return calculateExpenses()">
    <center>
        <table>
            
        <tr><td>Group Head Name</td>
        <td>
            <label for="groupHeadName" name="Group Head Name"></label>
            <input type="text" id="groupHeadName" name="groupHeadName" placeholder="Enter the Group Head Name"
            pattern="[A-Za-z ]+" required>
        </td>
        </tr>
        <tr><td>Email ID</td>
        <td>
            <label for="groupHeadEmail" name="EMail ID"></label>
            <input type="email" name="groupHeadEmail" id="groupHeadEmail" required>
        </td>
        </tr>
        
        <tr><td>Mobile Number</td>
        <td>
            <label for="groupHeadMobileNumber" name="Mobile Number"></label>
            <input type="text" id="groupHeadMobileNumber" name="groupHeadMobileNumber" placeholder="Enter the Mobile Number"
            pattern="^[789]{1}[0-9]{9}$" required>
        </td>
        </tr>
        
        <tr><td>Extra-Curricular Activity</td>
        <td>
            <label for="curricularActivity" name="Extra-Curricular Activity"></label>
            <input type="radio" id="curricularActivity" name="curricularActivity" value="Karate" required="">Karate
            <input type="radio" name="curricularActivity" id="curricularActivity2" value="Music" required>Music
        </td>
        </tr>
        
        <tr><td>No of Girls</td>
        <td>
            <label for="noOfGirls" name="No of Girls"></label>
            <input type="range" id="girlseval" max="500" min="0" required>
            <span id="demo">
        </span></td>
        </tr>
        
        <tr><td>No of Boys</td>
        <td>
        <label for="noOfBoys" name="No of Boys"></label>
        <input type="range" id="boyseval" max="500" min="0" required>
        <span id="demo1"></span>
        </td>
        </tr>
        
        <tr><td>
            <input type="submit" id="submit" value="Calculate Monthly Expense">
        </td>
        <td>
            <input type="reset" id="reset" value="Reset">
        </td></tr>
        
    </table>
    <div id="result"></div>
    </center>
    </form>
    
</body>
</html>

如何使 colors 按要求顯示? 我已經在 Chrome 和 Firefox 中嘗試過代碼。 兩種瀏覽器都有問題。

 body{
       background-color: #E6E6FA;
    }
    h1{
        color:#800080;
        font-family:cursive;
        text-align:center;
        
    }
    td#curricularActivity{
       background-color:#00FFFF;
    }

請從 Css 樣式中的顏色值中刪除雙引號,如上面的代碼所示。 使用更正的樣式檢查您的工作代碼

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM