1,Emmet语法
1.1 快速生成HTML结构
2,复合选择器
2.1 后代选择器
元素1必须包含元素2;
元素1 元素2 { 样式 }
2.2 子选择器
元素只能选择最近一级的子选择器
元素1>元素2 { 样式 }
2.3 并列选择器
同时选中多种元素,用,隔开
元素1,元素2 { 样式 }
2.4 伪类选择器
a: link /*选择所有未被访问的链接*/
a:visited /* 选择所有已被访问的链接*/
a: hover /*选择鼠标指针位于其上的链接*/
a: active /*选择活动链接(鼠标按下未弹起的链接) */
选出光标点击的区域
input:focus {
background-color:red;
}
3.,元素显示模式
元素显示模式是指标签以什么方式显示
HTML元素一般分为块元素和行元素两种类型
3.1 块元素:
3.2 行元素:
3.3 行内块元素
3.4 元素转化
盒子内文字布局
line-height: 与盒子向相同的px; <!-- 行高等与盒子,文字垂直居中,小于偏
上,大于偏下-->
4,背景
background-color 背景颜色
background-image 背景图片
background-image:url(图片地址);
4.1 背景平铺
backhround-repeat
4.2 背景位置
background-pastion
4.3 背景图像固定
background-attachment
4.4 背景的复合写法
background:颜色 图片 平铺 图像滚动 图片位置
4.5 背景颜色半透明
background:如果把(0,0,0,0.5) 最后一个值设定透明程度