Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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
div中的css粗体第一行_Css - Fatal编程技术网

div中的css粗体第一行

div中的css粗体第一行,css,Css,我在一页上有一堆像下面这样的div。css中有没有一种方法可以将第一行加粗(在之前)?所以,在本例中,我希望客户使用粗体 <div> Customer <br/> John Doe </div> 顾客 无名氏 使用伪元素 div::第一行{ 字号:700; } 顾客 无名氏 使用: div::第一行{ 字体大小:粗体; } 顾客 无名氏 是的,您正在查找::first-line伪元素 所以基本上你会: div::first-line{ fo

我在一页上有一堆像下面这样的div。css中有没有一种方法可以将第一行加粗(在

之前)?所以,在本例中,我希望客户使用粗体

<div>
Customer
<br/>
John Doe
</div>

顾客

无名氏
使用伪元素

div::第一行{
字号:700;
}

顾客

无名氏
使用:

div::第一行{
字体大小:粗体;
}

顾客

无名氏
是的,您正在查找::first-line伪元素

所以基本上你会:

div::first-line{
 font-weight:bold
}

有一个选择器。据报道,它得到了广泛的支持。MDN.

我不太擅长css,但希望这个伪元素doucmentation有助于更多地了解伪选择器。 感谢@MKN Web Solutions提供了出色且快速的答案


在web上搜索“css第一行”将为您提供准确的答案,告诉您如何做到这一点。这个问题似乎离题了,因为它没有显示任何努力或研究