gpt4 book ai didi

css - 浏览器无法识别我的段落标签的样式

转载 作者:行者123 更新时间:2023-11-28 04:51:27 26 4
gpt4 key购买 nike

无论出于何种原因,我的浏览器或编辑器都无法识别我为段落标签设置的样式。这是我的代码。非常感谢任何帮助:)

/* COLORS */
$color1: #000000;
$color2: #111111;
$color3: #222222;
$color4: #333333;
$color5: #444444;
$color6: #555555;

/* BODY TEXT */
p {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
font-size: 16px;
line-height: 26px;
color: #ffffff;
}

/* H1-H6 */
h1 {
font-size: 60px;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
color: #000;
letter-spacing: 0px;
}
h2 {
font-size: 50px;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
color: #000;
letter-spacing: 0px;
}
h3 {
font-size: 40px;
font-family: 'Open Sans', sans-serif;
font-weight: 500;
color: #000;
letter-spacing: 0px;
}
h4 {
font-size: 30px;
font-family: 'Open Sans', sans-serif;
font-weight: 300;
color: #000;
letter-spacing: 0px;
}
h5 {
font-size: 20px;
font-family: 'Open Sans', sans-serif;
font-weight: 100;
color: #000;
letter-spacing: 0px;
}
h6 {
font-size: 10px;
font-family: 'Open Sans', sans-serif;
font-weight: 100;
color: #000;
letter-spacing: 0px;
}
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet">
<link href="styleguide_sample.css" rel="stylesheet" type="text/css" >
<title>Title of project goes here</title>
</head>
<body>
<p>
<strong>This is body text:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas id malesuada felis. Sed efficitur scelerisque tortor, a ultricies tortor vestibulum non. Proin id nisi condimentum, ultrices tellus id, vehicula massa. Ut laoreet, purus at malesuada ornare, orci dui mattis elit, fermentum mollis dolor quam ut orci. Morbi consequat non nibh eget aliquam. Donec diam velit, volutpat ut ornare in, ultricies ac est. Aenean a ligula auctor, congue elit nec, fringilla eros. Mauris placerat ligula id neque fringilla, ut congue quam pellentesque. Aenean lacinia, velit ut fringilla tincidunt, tortor nisi faucibus quam, sed lobortis justo ex ac ipsum. Etiam et dolor eget metus ultrices tincidunt non ac erat. Integer non accumsan mi, sed consequat purus.
</p>
<h1>
This is Header 1
</h1>
<h2>
This is Header 2
</h2>
<h3>
This is Header 3
</h3>
<h4>
This is Header 4
</h4>
<h5>
This is Header 5
</h5>
<h6>
This is Header 6
</h6>
</body>
</html>

我已经测试过这是 firefox 和 chrome,它似乎唯一可以工作的地方是 Dreamweaver。我确定有一个简单的解决方案。我似乎无法确定它是什么。

ps:H1 - H6 标签似乎工作正常。唯一不起作用的是 P 标签的样式。

最佳答案

这可能是因为您的字体不支持给定的粗细。如果您使用以下内容,您可以获得粗体文本。正常权重一般是400,加粗权重一般是700,其他权重据我所知不保证支持。

p { 
font-family: 'Open Sans', sans-serif;
font-weight: 700;
font-size: 16px;
line-height: 26px;
color: #ffffff;
}

关于css - 浏览器无法识别我的段落标签的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40681515/

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