为什么我的html CSS样式表不起作用,使用内联还是样式标记?

问题描述 投票:0回答:1
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <Style type="text/CSS">
            h1{
                Colour:red;
            }
        </Style>
    </head>
    <body>
        <h1></h1>
    </body>
</html>

我无法弄清楚哪里出了问题?一切似乎都很好。

html css colors stylesheet
1个回答
0
投票
您拼写了“ color”属性:

下面的代码有效:

<!DOCTYPE html> <html> <head> <title></title> <Style type="text/CSS"> h1{ Color:red; } </Style> </head> <body> <h1>Test</h1> </body> </html>
© www.soinside.com 2019 - 2024. All rights reserved.