<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
p:before {
content:"Former - ";
color:red;
font-family:"Tahoma" ,Times New Roman;
font-size:70%;
}
p.normal:first-letter {
font-size:40px;
color:blue;
}
</style>
</head>
<body>
<p class="normal">First character of this paragraph will
be normal and will have font size 40px;</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这里,在内容:before伪元素显示为红色,但我也想式"的字符"F" ˚F蓝色这段IRST字符".但相反,我看到" F ormer - " 的" F "为蓝色.
我想要的是将内容之后的两个:before和第一个字母应用于同一段落.这可能吗?如果是这样,怎么样?.normal :before
我想知道这两行之间的区别:
p.intro a{color=# ff99ff;}
p .intro a{color=# ff99ff;}
Run Code Online (Sandbox Code Playgroud)
在第一示例中,在p和之间没有空间.intro,而在第二示例中,它们之间存在空间.
我想用一些例子来解释.