gpt4 book ai didi

HTML/CSS 代码没有正确显示或者我的代码有问题吗?

转载 作者:行者123 更新时间:2023-11-28 01:46:07 25 4
gpt4 key购买 nike

我是 HTML 和 CSS 的新手。我在 Atom 文本编辑器中编写的以下行在预览中未正确显示。字体未从默认的 Times New Roman 更改。即使在添加额外的字体包之后。但是,我没有使用任何花哨的字体。他们是不是我的代码有问题?

body {
font-family: Tahoma;
font-size: 16px;
}

#point1 {
font-family: Verdana;
color: orange;
margin-top: 10px;
margin-bottom: 10px;
}

#point2 {
font-family: Impact;
color: red;
margin-top: 10px;
margin-bottom: 10px;
}

#point3 {
font-family: Georgia;
color: pink;
margin-top: 10px;
margin-bottom: 10px;
}

#point4 {
font-family: Tahoma;
margin-top: 10px;
margin-bottom: 10px;
}
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
<title>Text</title>
</head>
<body>
<p> This is a paragraph. All of the text on this page has a font size of 16 pixels.
This paragraph, like most of the text on this page is black and uses Tahoma font.</p>
<ul>
<li id="point1">This list item uses the Verdana font and color orange.</li>
<li id="point2">This list item uses the Impact font and the color red.</li>
<li id="point3">This list item uses the Georgia font and the color pink.</li>
<li id="point4">This list item is black and uses the Tahoma font. It also contains a link to
<link href="http://www.spiced-academy.com"></link>
</ul>
<p>This is another paragraph. Each item in the list above has a top and bottom
margin of 10 pixels.</p>
</body>
</html>

最佳答案

我不确定这是问题所在,但尝试在链接 css 样式表上添加属性类型:

<link rel="stylesheet" href="stylesheet.css" type="text/css">

关于HTML/CSS 代码没有正确显示或者我的代码有问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50177839/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com