css

*****今天学的不够扎实,有很多地方没有懂,还需要巩固。


1、css层叠样式表
写法分类:
内联(行内)
写在标签里面,以属性的形式表现,属性名是style
内嵌
写在head标签里面,以标签的形式表现,标签名style
外部引用
写在head标签里面,以标签的形式表现,标签名link
2、样式格式:
样式名:样式值
样式名1:样式值1
...
选择器:找元素,找标签
选择器格式{
样式名:样式值;
样式名1:样式值1;}
3、选择器有哪些:
标签选择器 标签名
id选择器 #id属性值
class选择器 .class属性值
并列选择器 选择器1,选择器2 {}(关键符号:,)
后代选择器 选择器1 选择器2 {}(关键符号:空格)
属性选择器 选择器【属性名=‘属性值’】{}
4、优先级:行内的是最高优先级
(权值越高 优先级越高)
行内 1000
id 100
clear 10
标签 1
*(通用选择器) 0color: blue;字体颜色 font-weight:bold;字体加粗background: red底色
5、

一般样式:文本,背景,字体
布局:定位,浮动,显示
动画:渐变,旋转,3D

一般样式标签背景background-*
background-color
background-image
background-repeat
background-attachment
background-position
文本:text-*
color
text-align
text-background
text-indent
line-height 行高:尽量不要换行
字体:font-*
font-family
font-size
font—weight
列表 list-*
list-style—type
list-style—imag
list-style—type

原文地址:https://www.cnblogs.com/ybygb-geng/p/9295872.html