# CSS与CSS3
定位
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
position<span class="token2">:</span> absolute<span class="token2">;</span><span class="token6">//脱离文档 绝对定位</span>
relative 相对定位
fixeld 不滚动
static 默认
z<span class="token">-</span>index<span class="token2">:</span> <span class="token3">1</span><span class="token2">;</span>层关系
top<span class="token2">:</span> auto<span class="token2">;</span>
left<span class="token2">:</span> auto<span class="token2">;</span>
right<span class="token2">:</span> auto<span class="token2">;</span>
bottom<span class="token2">:</span> auto<span class="token2">;</span>
<span class="token2">}</span>
```
```
布局
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
display<span class="token2">:</span>inline<span class="token2">;</span>默认内联元素
none 隐藏
block 块元素
inline<span class="token">-</span>block 内联块元素
float<span class="token2">:</span>none<span class="token2">;</span>不浮动
left right
clear<span class="token2">:</span> both<span class="token2">;</span>清除浮动
visibility<span class="token2">:</span> visible<span class="token2">;</span>对象可视
hidden对象隐藏
overflow<span class="token2">:</span> visible<span class="token2">;</span>溢出内容不作处理<span class="token2">,</span>可能超出容器
hidden隐藏不出现滚动条
scroll滚动
auto溢出出现滚动<span class="token2">,</span>不溢出没有
overflow<span class="token">-</span>x<span class="token2">:</span> visible<span class="token2">;</span>
overflow<span class="token">-</span>y<span class="token2">:</span> visible<span class="token2">;</span>
同上<span class="token2">,</span>表示水平方向和垂直方向
<span class="token2">}</span>
```
```
尺寸,支持像素 em 百分比等
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
width<span class="token2">:</span> auto<span class="token2">;</span>
<span class="token3">12</span>px <span class="token3">10</span><span class="token">%</span>
min<span class="token">-</span>width<span class="token2">:</span> <span class="token3">0</span><span class="token2">;</span>
max<span class="token">-</span>width<span class="token2">:</span> none<span class="token2">;</span>没有最大宽度
height<span class="token2">:</span> auto<span class="token2">;</span>
min<span class="token">-</span>height<span class="token2">:</span> <span class="token3">0</span><span class="token2">;</span>
max<span class="token">-</span>height<span class="token2">:</span> none<span class="token2">;</span>
<span class="token2">}</span>
```
```
内外补白
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
margin<span class="token2">:</span> auto<span class="token2">;</span>可以负值
margin<span class="token">-</span>top<span class="token2">:</span> auto<span class="token2">;</span>上
margin<span class="token">-</span>bottom<span class="token2">:</span> auto<span class="token2">;</span>下
margin<span class="token">-</span>left<span class="token2">:</span> auto<span class="token2">;</span>
margin<span class="token">-</span>right<span class="token2">:</span> auto<span class="token2">;</span>
padding<span class="token2">:</span> <span class="token3">1</span>px<span class="token2">;</span>不可以负值<span class="token2">,</span>也没有自动
padding<span class="token">-</span>bottom<span class="token2">:</span><span class="token3">1</span><span class="token">%</span><span class="token2">;</span>
padding<span class="token">-</span>top<span class="token2">:</span> inherit<span class="token2">;</span>
padding<span class="token">-</span>left<span class="token2">:</span> inherit<span class="token2">;</span>
padding<span class="token">-</span>right<span class="token2">:</span><span class="token3">1</span>px<span class="token2">;</span>
<span class="token2">}</span>
```
```
边框
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
border<span class="token2">:</span> <span class="token3">1</span>px solid #fff<span class="token2">;</span>
border<span class="token">-</span>width<span class="token2">:</span> <span class="token3">1</span>px<span class="token2">;</span>
border<span class="token">-</span>style<span class="token2">:</span> solid<span class="token2">;</span>实线
none<span class="token2">;</span>没有边框<span class="token2">,</span>默认值
dotted<span class="token2">;</span>点状
dashed<span class="token2">;</span>虚线
border<span class="token">-</span>color<span class="token2">:</span> #fff<span class="token2">;</span>
border<span class="token">-</span>top<span class="token2">:</span> <span class="token3">1</span>px solid #fff<span class="token2">;</span>
border<span class="token">-</span>bottom<span class="token2">:</span> <span class="token">!</span>important<span class="token2">;</span>
border<span class="token">-</span>left<span class="token2">:</span> <span class="token">!</span>important<span class="token2">;</span>
border<span class="token">-</span>right<span class="token2">:</span> <span class="token">!</span>important<span class="token2">;</span>
<span class="token2">}</span>
```
```
背景
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
background<span class="token2">:</span><span class="token1">url</span><span class="token2">(</span>test1<span class="token2">.</span>jpg<span class="token2">)</span> no<span class="token">-</span>repeat scroll <span class="token3">0</span><span class="token">%</span> <span class="token3">0</span><span class="token">%</span><span class="token2">;</span>
background<span class="token">-</span>color<span class="token2">:</span> transparent<span class="token2">;</span>默认透明
background<span class="token">-</span>image<span class="token2">:</span> none<span class="token2">;</span>无图
<span class="token1">url</span><span class="token2">(</span><span class="token3">1.</span>img<span class="token2">)</span>
background<span class="token">-</span>repeat<span class="token2">:</span> repeat<span class="token2">;</span>平铺
no<span class="token">-</span>repeat 不平铺
repeat<span class="token">-</span>x <span class="token2">;</span>repeat<span class="token">-</span>y 横纵平铺
background<span class="token">-</span>attachment<span class="token2">:</span> scroll<span class="token2">;</span> 滚动
fixed<span class="token2">;</span>固定
background<span class="token">-</span>position<span class="token2">:</span> <span class="token3">0</span><span class="token">%</span> <span class="token3">0</span><span class="token">%</span><span class="token2">;</span>
left center right top bottom<span class="token2">;</span>
background<span class="token">-</span>origin<span class="token2">:</span> padding<span class="token">-</span>box<span class="token2">;</span>背景从content显示
border<span class="token">-</span>box<span class="token2">;</span>从border区域开始
padding<span class="token">-</span>box<span class="token2">;</span>从padding开始
background<span class="token">-</span>clip<span class="token2">:</span> border<span class="token">-</span>box<span class="token2">;</span>从padding向外剪裁
border<span class="token">-</span>box<span class="token2">;</span>从border开始<span class="token2">,</span>不含
content<span class="token">-</span>box<span class="token2">;</span>从content开始剪切
text<span class="token2">;</span>从内容开始
background<span class="token">-</span>size<span class="token2">:</span> auto<span class="token2">;</span>背景大小自动
cover<span class="token2">;</span>等比缩放完全覆盖<span class="token2">,</span>会出容器
contain<span class="token2">;</span>等比缩放宽高和容器相等<span class="token2">,</span>始终在容器内
<span class="token2">}</span>
```
```
颜色
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
color<span class="token2">:</span> #FFF<span class="token2">;</span>文本颜色
opacity<span class="token2">:</span> <span class="token3">1</span><span class="token2">;</span><span class="token3">1</span>是不透明 <span class="token3">0</span>完全透明 取值<span class="token3">0.0</span><span class="token">-</span><span class="token3">1</span>
<span class="token2">}</span>
```
```
字体
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
font<span class="token2">:</span> <span class="token3">12</span>px Simsun<span class="token2">,</span>arial<span class="token2">,</span>sans<span class="token">-</span>serif<span class="token2">;</span>
font<span class="token">-</span>style<span class="token2">:</span> normal<span class="token2">;</span>字体正常
italic<span class="token2">;</span>斜体
font<span class="token">-</span>weight<span class="token2">:</span> normal<span class="token2">;</span>正常相当于<span class="token3">400</span>
bold 粗体相当于<span class="token3">700</span>
bolder 特粗 相当于b strong
font<span class="token">-</span>size<span class="token2">:</span><span class="token3">12</span>px<span class="token2">;</span>
font<span class="token">-</span>family<span class="token2">:</span> arial<span class="token2">;</span>
<span class="token2">}</span>
```
```
文本
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
text<span class="token">-</span>transform<span class="token2">:</span> none<span class="token2">;</span>
capitalize<span class="token2">;</span>首字母大写
uppercase<span class="token2">;</span>转换大写
lowercase<span class="token2">;</span>转小写
white<span class="token">-</span>space<span class="token2">:</span> normal<span class="token2">;</span>空格处理默认
pre<span class="token">-</span>wrap<span class="token2">;</span>不合并空白<span class="token2">,</span>边界处换行
nowrap<span class="token2">;</span>强制同一行显示<span class="token2">,</span>合并多余空白<span class="token2">,</span>直到br
word<span class="token">-</span><span class="token5">break</span><span class="token2">:</span> normal<span class="token2">;</span>换行
<span class="token5">break</span><span class="token">-</span>all<span class="token2">;</span>
word<span class="token">-</span>wrap<span class="token2">:</span> normal<span class="token2">;</span>
<span class="token5">break</span><span class="token">-</span>word<span class="token2">;</span>边界处换行
text<span class="token">-</span>align<span class="token2">:</span> center<span class="token2">;</span>left<span class="token2">;</span>right<span class="token2">;</span>
text<span class="token">-</span>indent<span class="token2">:</span> <span class="token3">0</span><span class="token2">;</span>缩进
vertical<span class="token">-</span>align<span class="token2">:</span> baseline<span class="token2">;</span>
sub<span class="token2">;</span>下标
super<span class="token2">;</span>上标
middle<span class="token2">;</span>居中
line<span class="token">-</span>height<span class="token2">:</span> normal<span class="token2">;</span>行高
<span class="token2">}</span>
```
```
列表样式
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
list<span class="token">-</span>style<span class="token2">:</span>disc outside none<span class="token2">;</span>
list<span class="token">-</span>style<span class="token">-</span>image<span class="token2">:</span> none<span class="token2">;</span>不指定图像
list<span class="token">-</span>style<span class="token">-</span>position<span class="token2">:</span> outside<span class="token2">;</span>文本以外
inside<span class="token2">;</span>文本以内
list<span class="token">-</span>style<span class="token">-</span>type<span class="token2">:</span> disc<span class="token2">;</span>实心圆
circle<span class="token2">;</span>空心圆
square<span class="token2">;</span>实心方块
decimal<span class="token2">;</span>数字
none<span class="token2">;</span>不使用
<span class="token2">}</span>
```
```
表格样式
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
border<span class="token">-</span>collapse<span class="token2">:</span> collapse<span class="token2">;</span>合并边框
<span class="token2">}</span>
```
```
用户界面
```
<pre class="calibre14">```
<span class="token2">.</span>c<span class="token2">{</span>
text<span class="token">-</span>overflow<span class="token2">:</span> clip<span class="token2">;</span>文本溢出不显示<span class="token2">.</span><span class="token2">.</span><span class="token2">.</span>
ellipsis<span class="token2">;</span>显示
outline<span class="token2">:</span> none<span class="token2">;</span>轮廓样式无轮廓
cursor<span class="token2">:</span> pointer<span class="token2">;</span>手 move移动
支持<span class="token1">url</span><span class="token2">(</span><span class="token2">)</span>
box<span class="token">-</span>sizing<span class="token2">:</span> content<span class="token">-</span>box<span class="token2">;</span>盒子padding和border不包括在宽高内
border<span class="token">-</span>box<span class="token2">;</span>包含内<span class="token2">;</span>
user<span class="token">-</span>select<span class="token2">:</span>text<span class="token2">;</span>可以选择文本
none<span class="token2">;</span>文本不能选择
<span class="token2">}</span>
```
```
选择
```
<pre class="calibre16">```
ul<span class="token">></span>li<span class="token2">{</span>
<span class="token6">//子选择器</span>
<span class="token2">}</span>
ul li<span class="token2">{</span>
<span class="token6">//包含选择</span>
<span class="token2">}</span>
p<span class="token">+</span>p<span class="token2">{</span>
<span class="token6">//相邻选择</span>
<span class="token2">}</span>
p<span class="token">~</span>p<span class="token2">{</span>
<span class="token6">//兄弟选择</span>
<span class="token2">}</span>
input<span class="token2">[</span>type<span class="token">=</span><span class="token4">"text"</span><span class="token2">]</span><span class="token2">{</span><span class="token2">{</span>
<span class="token6">//属性选择</span>
<span class="token2">}</span>
a<span class="token2">:</span>link<span class="token2">{</span>
<span class="token2">}</span>
a<span class="token2">:</span>visited<span class="token2">{</span>
<span class="token2">}</span>
a<span class="token2">:</span>hover<span class="token2">{</span>
<span class="token2">}</span>
a<span class="token2">:</span>active<span class="token2">{</span>
<span class="token2">}</span>
a<span class="token2">:</span>focus<span class="token2">{</span>
<span class="token2">}</span>
ul li<span class="token2">:</span>first<span class="token">-</span>child<span class="token2">{</span>
<span class="token6">//第一个</span>
<span class="token2">}</span>
ul li<span class="token2">:</span>last<span class="token">-</span>child<span class="token2">{</span>
<span class="token6">//最后一个</span>
<span class="token2">}</span>
```
```
- 简介
- 第一章 数据库
- Mysql/mariadb
- 函数
- 基础
- 增删改索引
- 标准查询
- 高级查询
- TIDB集群mysql解决方案
- Redis
- 语言基础
- 5种数据类型
- 其他类型
- Sqlite
- 语言基础
- 常用查询
- 第二章 PHP
- 语言基础
- 第一课 流程控制和运算
- 第二课 数组
- 第三课 日期时间
- 第四课 常用函数
- 第五课 字符串
- 第六课 文件操作
- 第七课 面向对象
- 第八课 正则表达式
- 第九课 图片处理生成
- 第十课 curl/memche
- 第十一课 mysql和pdo
- 第十三课 cookie和session
- 第十四课 xml操作
- 第十五课 php5.3+新特性
- 第十六课 php7+
- 第十七课 密码安全
- 废弃函数
- php命令行
- redis应用
- 算法
- 排序算法
- 基础算法
- 无限级分类
- 自定义函数Fn
- 查找算法
- 自定义函数数据函数fn
- laravel
- 路由
- 常用语句
- 数据库
- dingo/api
- Yii2
- 控制器
- 常用类
- 数据库
- redis
- thinkphp6
- TP6文档
- TP6插件
- dedecms
- 织梦标签大全
- 数据库操作
- 内置函数和定义函数
- 织梦核心改动
- 织梦插件/底层标签开发
- PHP相关工具
- composer
- php开发环境phpenv
- Phpstorm使用
- windows编译php扩展
- PHP开源库
- 开源项目管理禅道
- sns_auth
- php-casbin权限控制
- php-jwt
- 微信SDKeasywechat
- querylist采集库
- workerman
- Box/Spout处理excel和csv
- dll扩展
- redis/memche/xdebug
- redis
- Lua
- php_xlswriter
- event
- swoole
- 常用代码库
- 微擎框架
- 第一课全局变量
- 第二课常用函数
- 第三课自定义微擎独有函数
- 第四课数据库操作
- 第五课微信端回复
- 第六课微擎高级操作
- 第八课global函数列表
- mainfest.xml详解
- js方法
- 人人商城
- 第一课model解读
- 第二课常用语句解读
- 第三课常用js解读
- 第四课附录常见问题
- 第五课附录处理报表|支付
- 常用JSON状态码
- 第三章 JavaScript
- js基础
- 浏览器对象
- 语言基础
- html5接口
- ES6新语法
- vue
- 基础语法
- 京东vueUI组件
- uniapp
- 组件开发规范
- nodejs
- 基础知识
- 安装node
- nvm不同版本node切换
- js常用标准库
- zepto/jquery
- weui
- js图标库
- elementUI
- validator表单验证
- layer弹出层
- requirejs
- wow动画
- 动画animate
- swiper4
- 百度编辑器
- flyio/axios/qs
- jquery.form
- bootstrap3
- clipboard复制
- slideout侧滑
- imagehover.css图片悬停动画
- webpack打包
- Bulma UI框架
- store 客户端存储
- lottie动画创建库
- sweetalert
- js自定义函数
- 常见JSSDK
- 微信公众号JSSDK
- 腾讯地图jssdk
- 微信小程序
- 第四章 编程语言
- markdown语言
- Dart语言
- Dart语言基础
- Flutter框架
- Lua语言
- 字符串,数组,表
- 自定义方法
- go语言
- 第1.1语言基本语法
- 第1.2流程控制
- 第1.3函数
- 第1.4结构体
- 第1.5接口
- 第1.6包
- go语言框架Gin
- CSS3语言
- CSS与CSS3
- 选择符
- 属性
- css3
- loading动画
- HTML5语言
- less
- sass
- C#
- 基础知识
- 函数
- 第五章 开发工具
- git
- nginx/apache服务器
- Linux常用操作
- crontab定时任务
- 注册表与cmd
- 阿里云ECS
- frp穿透和ssl续期
- 宝塔安装
- 树莓派
- 浏览器模拟
- 火狐/chrome常用插件
- WSL安装使用
- mac brew和终端命令
- win10相关