为什么css不能与这个div一起工作?
16lz
2021-01-22
So I have a body here:
所以我有一个身体
<body>
<div id=”first”>
<span class=”red”>This is a DIV Container</span>
Or
<br>
This
</div>
And I have a style sheet with this
我有一个样式表
#first{
background-color:red;
}
But the background color doesn't change. I have no idea what I'm doing wrong...
但是背景颜色不会改变。我不知道我做错了什么……
Here's a jsfiddle with the code
这是一个带有代码的jsfiddle。
https://jsfiddle.net/fuz5uqfb/
https://jsfiddle.net/fuz5uqfb/
Doesn't worth there either.
不值得。
1 个解决方案
#1
5
You're using the wrong kind of quotation marks for your div id
and span class
. It should be this:
您正在使用错误的类型的引号为您的div id和span类。它应该是这样的:
<body>
<div id="first">
<span class="red">This is a DIV Container</span>
Or
<br>
This
</div>
</body>
Updated Fiddle
更多相关文章
- 如何控制html代码中DL标签的颜色?
- 有没有办法从指定的网站找到某种颜色的图像?
- php单引号和双引号的区别
- 单引号,双引号,javascript,HTML,转义字符
- PHP & GD -透明背景填充附近的颜色。
- fgetcsv()错误地将双引号添加到第一行的第一个元素
- mysql where in形式存储过程如何传递带有单引号的入参
- 使用Jquery Ajax更改按钮的颜色(从外部PHP文件接收颜色)
- 对象的属性也要加引号吗