css
2024-04-01 13:35:13 0 举报
css简单总结
作者其他创作
大纲/内容
css在网页中的应用
css的发展史
css的优势
css概念
style
css基本语法
行内样式
内部样式 <style> </style>
外部样式 <link rel=\"stylesheet“href=\"css/style.css\">
3种引入的方式
标签
id #
class .
基本选择器
后代选择器
子选择器
相邻兄弟选择器
通用选择器
层次选择器 > ~ +
结构伪类选择器
= 绝对等于
*= 包含这个元素
^= 以这个开头
$= 以这个结尾
属性选择器 a{* ^ $}
高级选择器
css的选择器
初始及入门
字体颜色:color
字体大小:font-size
字体类型:font-family
字体粗细:font-weight
字体
对齐方式:text-align:居中(center), right, left;
首行缩进:text-indent: em;
行高:line-height: px;
装饰:text-decoration:下划线(underline),中划线 (line-through),上划线(overline)
网页排版
:hover
超链接伪类
list-style:去掉原点(none) 空心圆 (circle) 数字 (decimal) 正方形 (square);
列表样式
背景颜色
repeat
........
https://www.grabient.com
渐变背景
背景图片
背景样式
美化网页
边框 border
内边距 padding
外边距 margin
盒子模型尺寸计算:boder+margin+padding+内容元素
box-size
圆角边框 border-radius
阴影:box-shadow
盒子模型
标准文档流
网页布局
block
inlin
inline-block
none
display
左浮动:left
右浮动:right
清除浮动:clear:both;
浮动 float
left
right
both
clear
空 div
父元素高度
overflow
父级添加一个伪类:after
解决父级边框塌陷问题
清除浮动
inline-block float
浮动
relative 相对定位
absolute 绝对定位
fixed 固定定位
z-index
opcity 透明度
定位
css
0 条评论
回复 删除
下一页