Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 尝试为第1个<;p>;使用具有相同类的sass的div中的元素_Html_Css_Sass - Fatal编程技术网

Html 尝试为第1个<;p>;使用具有相同类的sass的div中的元素

Html 尝试为第1个<;p>;使用具有相同类的sass的div中的元素,html,css,sass,Html,Css,Sass,下面是我的代码。随着第二个变得越来越大胆。我只需要先用黑体字。我不想为第一个添加任何类 .person{ p+p{ 字体大小:粗体; } } 我很好 你也很好 .personp:first of type{}甚至。personp:first child{}可以工作。您正在使用的选择器字面上翻译为“紧跟在class.person中段落之后的段落”。person p:type{}的第一个,甚至是。person p:first child{}可以工作。您使用的选择器字面上翻译为“class.per

下面是我的代码。随着第二个
变得越来越大胆。我只需要先用黑体字。我不想为第一个
添加任何类

.person{
p+p{
字体大小:粗体;
}
}

我很好

你也很好


.personp:first of type{}
甚至
。personp:first child{}
可以工作。您正在使用的选择器字面上翻译为“紧跟在class.person中段落之后的段落”

。person p:type{}
的第一个,甚至是
。person p:first child{}
可以工作。您使用的选择器字面上翻译为“class.person中紧跟在段落之后的段落”

我也会使用p:first类型选择器,我也会使用p:first类型选择器
.person {
  p:first-child {
    font-weight: bold;
  }
}