小编swa*_*i16的帖子

如何将CSS应用到第一个字母后:内容之前?

<!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

css pseudo-element

8
推荐指数
2
解决办法
6157
查看次数

CSS-descendent选择器

我想知道这两行之间的区别:

p.intro a{color=# ff99ff;}
p .intro a{color=# ff99ff;} 
Run Code Online (Sandbox Code Playgroud)

在第一示例中,在p和之间没有空间.intro,而在第二示例中,它们之间存在空间.

我想用一些例子来解释.

css css-selectors

0
推荐指数
1
解决办法
227
查看次数

标签 统计

css ×2

css-selectors ×1

pseudo-element ×1