css常用标签
style
opacity: 0-1 0全透明 元素里面所有透明属性
1表示完全不透明
rgba(0,0,0,0.5); raba(0-255 0-255 0-255 opacity)
display: block; 块元素
ul li:nth-child(odd) 选择奇数 li
width 宽
height 高
background 背景 color颜色
border: 边框宽 边框的线条类型 边框颜色
dotted 虚线
black 黑色
green 绿色
white 白色
brown 棕色
orange 橘色
margin 外边距
padding:; 内边距
display:inline; 行内块
浮动
float:left; 左浮动
float:right 右浮动
align="center" 居中
margin : 0 auto;DIV居中
font-size 字体大小
font-family 字体样式
clear:both 清除浮动
solid 实线
font-weight:bold 加粗
normal 取消加粗
font-style:italic 倾斜
list-style:none; 清除 无序列表点
text-decoration:none; 清除A标签下划线
text-indent:2em; 首行缩进2字符
border:1px dashed 虚线
font-style:italic 倾斜
text-align:left 水平对齐方式
vertical-align:top垂直对齐方式
line-height 行高
text-decoration:none: 没有修饰
underline: 添加下划线
overline: 添加上划线
line-through: 添加删除线
text-transform:none
overflow:hidden;溢出内容为隐藏:
a:link {属性:属性值;}超链接的初始状态;
a:visited {属性:属性值;}超链接被访问后的状态;
a:hover {属性:属性值;}鼠标悬停,即鼠标划过超链接时的状态;
a:active {属性:属性值;}超链接被激活时的状态,即鼠标按下时超链接的状态
Link--visited--hover--active。
target="_blank"链接在 新窗口打开
_self 新窗口
background-repeat no-repeat不平铺
background-position 位置
background-attachment:scroll; 背景随内容一块滚动 fixed; 固定
overflow-hidden; 父子不受影响
letter-spacing:value; 字间距。
word-spacing:value; 词间距。
layout-flow:horizontal/vertical-ideographic;文本流控制
list-style-type:
disc (实心圆)
/circle (空心圆)/
square (实心方块)
/none (去掉列表符号);
list-style-image:url (所使用图片的路径及全称);
list-style-position:outside (外边)
/inside (里边);
list-style:none; 去掉列表符号
background-color: 颜色值;} 背景颜色 {
background-image:url (背景图片的路径及全称);
{background-repeat:no-repeat 不平铺/
repeat平铺/
repeat-x X轴平铺/
repeat-y Y轴平铺 }
background-position:left/
center/right/数值 背景图的位置{ top/center/bottom/数值;}
border: 边框宽度 边框风格 边框颜色;
例如:{border:5px solid #f00;}
border-width: 边框宽度:
border-color: 边框颜色:
border-style:solid (实线)/
dashed (虚线)
dotted (点线)/
double (双线)
transparent 透明色
section元素 表示页面中的一个内容区块
article元素 表示一块与上下文无关的独立的内容
aside元素 在article之外的,与article内容相关的辅助信息
header元素 表示页面中一个内容区块或整个页面的标题
footer元素 表示页面中一个内容区块或整个页面的脚注
nav元素 表示页面中导航链接部分
figure元素 表示一段独立的流内容,使用figcaption元素为其添加标题(第一个或最后一个子元素的位置)
vertical-align:top 取消图片间距
cellspacing="单元格与单元格之间的间距"
cellpadding="单元格与内容之间的空隙"
valign=" top顶对齐/
middle居中/
bottom底对齐/
baseline(基线);
background-repeat no-repeat不平铺
background-position 背景图位置
background-attachment:scroll; 背景随内容一块滚动
fixed; 固定
local:滚动元素背景图滚动
background-image:url背景图设置
alt 图片提示信息
title 图片信息文字
ackground: linear-gradient(to right, red , blue)线性渐变色
font-family 字体样式
font-style:italic 倾斜
text-decoration: none:没有修饰
underline:添加下划线
overline:添加上划线
line-through:添加删除线
letter-spacing:value字间距
强制文本在一行内显示:white-space:nowrap;
溢出内容为隐藏:overflow:hidden;
溢出文本显示省略号:text-overflow:ellipsis;\
overflow:
visible:默认值,溢出内容会显示在元素之外;
hidden:溢出内容隐藏;
scroll:滚动,溢出内容以滚动方式显示;
auto:如果有溢出会添加滚动条,没有溢出正常显示
inherit:规定应该遵从父元素继承overflow属性的值
overflow-x:X轴溢出;
overflow-y:Y轴溢出
white-space:
normal:默认值,空白会被浏览器忽略,
nowrap:文本不会换行,文本会在同一行上继续,直到遇到
标签为止
pre:空白会被浏览器保留,其行为方式类似HTML中的pre标签;
pre-wrap:保留空白符序列,但是正常的进行换行;
pre-line:合并空白符序列,但是保留换行符;
inherit:规定应该遵从父元素继承White-space属性的值;
text-overflow:
clip:不显示省略号(...);
ellipsis:显示省略标记;
dispaly:none 隐藏元素
position: 定位
static:默认的定位方式 结果就是定位和不定位没啥区别
absolute:绝对定位
relative:相对定位
fixed: 固定定位
sticky:粘性定位
z-index: 改变层叠关系
opacity: 0-1 0全透明 元素里面所有透明属性
1表示完全不透明
rgba(0,0,0,0.5); raba(0-255 0-255 0-255 opacity)
万能清除法:高度塌陷
aftef{
content:""
display:block
clear:both
height:0px;
overfolw:hidden;
:first-letter:定义对象内第一个字符的样式
:first-line:定义对象内第一行的样式。
min-width:最小宽度
max-height最大
max-width :100%用手机占屏幕
calc( 100% - 90px)计算公式 有空格
属性值+!important; 优先级高
cursor:crosshair(十字架)pointer(手形)