gpt4 book ai didi

html - 无法让我的 CSS 工作

转载 作者:可可西里 更新时间:2023-11-01 13:46:47 25 4
gpt4 key购买 nike

我无法让我的 CSS 工作。

codepen.io

即使代码可以运行,它不会给我黑色背景吗?

代码:

potnav {
padding: 16px;
color: white;
background-color: black;
}
<div class="potnav">hei</div>

最佳答案

类声明语法错误。使用 .ClassName 应用样式。查看工作示例。

<!DOCTYPE html>
<html>

<head>
<style>
.potnav {
padding: 16px;
color: white;
background-color: black!important;
}
</style>
</head>

<body>
<div class="potnav">hei</div>
</body>

</html>

关于html - 无法让我的 CSS 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41294820/

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