2

我开始创建一个简单的静态 HTML 网站,但我意识到,出于某种原因,它没有显示任何 css 样式。起初我认为这是一个链接问题,但后来我意识到即使在 HTML 文件中样式属性也不起作用。这是一个简单的例子:

<!DOCTYPE html>
<head>
    <link rel="stylesheet" type="text/css" href="../style.css">
    <meta charset="utf-8" />
</head>

<body>
    <p style="text-decoration: underlined;">This is my body green</p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
    <p>This is my body </p>
</body>

和样式表:

body {
    background: #c9c9c9;

}

有什么建议吗?

4

2 回答 2

3

你有<p style="text-decoration: underlined;">This is my body green</p>

你需要<p style="text-decoration: underline;">This is my body green</p>

underline不是underlined。_

在您遵循 Tieson T. 的建议并使用正确的 HTML 标记之后,这将解决您的内联 CSS 问题。

于 2013-04-09T04:45:07.080 回答
2

你试试这个

 <!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css"> --->MAKE SURE OF DESIRED    PATH
<meta charset="utf-8" />
</head>
<body>
<p style="text-decoration: underline;">This is my body green</p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
<p>This is my body </p>
</body>
</html> ---->Close HTML TAG
于 2013-04-09T04:52:57.557 回答