选择器笔记

2层次选择器
(1)后代选择器
选择器1 选择器2      body p
(2)子选择器
选择器1>选择器2
(3)紧邻它后面的第一个兄弟元素选择器
选择器1+选择器2
(4)后面的所有兄弟元素选择器
选择器1~选择器2
 
3伪结构选择器
:first-child
:last-child
:nth-child(n)
:first-of-type
:last-of-type
:nth-of-type(n)
 
4伪元素选择器(可以用于任何元素上,常用于超链接上)
:link 正常外观
:hover  悬停
:active  激活
:visited  访问过的
 
0000005属性选择器
<标签   属性名="属性值"  ....></标签>
[属性名]
[属性名=属性值]
[属性名^=属性值的关键字]   以什么关键字开头
[属性名$=属性值的关键字]   以什么关键字结尾
[属性名*=属性值的关键字]
 
 
页面中的空格:
写多个半角空格,浏览器只能识别一个
解决方案:
1、全角空格
2、&nbsp; 代表了一个半角空格,推荐
 
<   &lt;
   >  &gt;
原文地址:https://www.cnblogs.com/Inati/p/15060505.html