为什么引号不能在我的HTML文件中指定类 [英] Why will quotes not work to specify classes in my HTML file
问题描述
css
.task {
颜色:黑色;
text-align:left;
padding-left:25px;
font-size:.875em;
宽度:50%;
位置:相对;
border-style:none;
background-color:white;
}
.task .green {
font-size:.875em;
颜色:#8E8E8E;
}
HTML
< p class =task>< / p> ;
这是有效的
< p class =task green>< / p>
这不起作用?在检查器中显示奇怪的字符。嗨!
我尝试了什么:
检查了所有代码尝试了不同的空间组合。
删除两个类之间的空格
。task.green
请参考多个班级/ ID和班级选择器CSS-Tricks [ ^ ]
css
.task {
color:black;
text-align: left;
padding-left:25px;
font-size:.875em;
width:50%;
position: relative;
border-style: none;
background-color: white;
}
.task .green {
font-size: .875em;
color: #8E8E8E;
}
HTML
<p class="task"></p>
this works
<p class="task green"></p>
this does not work? Shows up weird characters in inspector. Hep!
What I have tried:
Checked all the code, tried different space combinations.
remove the space between two class
.task.green
refer Multiple Class / ID and Class Selectors | CSS-Tricks[^]
这篇关于为什么引号不能在我的HTML文件中指定类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!