gpt4 book ai didi

html - 为什么我不能添加边框宽度

转载 作者:行者123 更新时间:2023-11-28 15:59:51 24 4
gpt4 key购买 nike

我是 CSS 新手。我试图在文本周围创建边框,但边框没有出现。还有在线编辑器可以告诉我标签中的错误,甚至是拼写错误?

 <!DOCTYPE html>

<html>
<head>
<title> CSS Practice
</title>
<style>
p. one {border-width: 2px; border-style: solid;}
</style>
</head>

<body>
<p class="one"> My name is xyz </p>
</body>
</html>

最佳答案

您的选择器应该是p.one,而不是p.not

p .not 将在 p 中寻找 .not

p.one {
border-width: 2px;
border-style: solid;
}
<p class="one">My name is xyz</p>

关于html - 为什么我不能添加边框宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27733349/

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