@File
2019-10-08T11:17:40.000000Z
字数 4689
阅读 136
web
<link tpye="text/css" rel="stylesheet" href=“文档地址.css" />
- 链接CSS样式文件代码。
<style type="text/css"></style>
- html页面样式输入格式
*{影响整体属性}
#id{大括号扩选属性;分号为一个属性的结束;}
.class{}
.class ul li{class中li标签属性输入格式}
#id a{id中a标签属性输入格式}
#id:hover{伪累属性输入格式}
属性style
index | width | height | background |
---|---|---|---|
首页 | 宽度 | 长度 | 背景 |
border | padding | margin | float |
描边 | 外边距 | 内边距 | 浮动 |
text-align:center | line-height | font-family | display:none |
文本居中 | 行高 | 字体 | 不显示 |
top | center | bottom | auto |
顶部 | 中心 | 底部 | 自动 |
width:auto | cursor:pointer | list-style | position |
通栏 | 鼠标变手指 | li列表属性 | 位置 |
clear:left | overflow:hidden | display:none | display:block |
清楚左边样式 | 蒙版 | 不显示 | 显示 |
border-radius | text-decoration:none | first-child | font-weight |
边角半径 | 去除文本装饰 | 第一个子标签 | 文字重量 |
solid | dashed | dotted | text-indent:2em |
实线 | 粗虚线 | 虚线 | 首行缩进 |
position:fixed | position:relatve | position:absolute | .ckstyle |
绝对定位 | 相对定位 | 定位 | click的属性 |
background-color | background-image | text-decoration:underline | background-position |
背景颜色 | 背景图片 | 文本添加下划线 | 背景定位 |
background-repeat | no-repeat | repeat-x | repeat-y |
背景重复 | 不重复 | 纵向重复 | 横向重复 |
z-index:1 | background:url() | background:# | list-style:none |
Z轴层级 | 背景图片缩写 | 背景颜色缩写 | 去除列表样式 |
transition | outline | rows | cols |
过度 | 四周描边 | 行 | 列 |
inline-block | transform:rotate() | scale(1,1) | skew(deg) |
呈现为内联对象 | 旋转变形 | 缩放(x,y) | 倾斜 |
deg | ms | line-height:normal | inherit |
角度 | 毫秒 | 标准行高 | 继承父级 |
transparent | vertical-align:middle | white-space:nowrap | linear |
透明显示 | 垂直对齐居中 | 文本不换行 | 匀速 |
ease-in | ease-out | ease-in-out | ease |
缓慢开始 | 缓慢结束 | 慢-快-慢 | 逐渐变慢 |
column | column-count:2 | text-overflow:ellipsis | column-rule |
文本专栏 | 专栏总数2个 | 溢出文本省略 | 专栏间隔装饰 |
column-gap | rgba() | hsla() | linear-gradient |
专栏间隔 | RGB设置颜色 | HSL设置颜色 | 线性渐变 |
background-clip:pandding-box | background-size:contain | background-size:cover | text-shadow |
背景显示域 | 背景图适应边框 | 背景图放大铺满 | 文字阴影 |
box-shadow | box-reflect | box-orient:horizontal | box-flex |
盒子阴影 | 盒子倒影 | 垂直排列子元素 | 盒子所占比 |
animation | animation-name: | animation-iteration-count: | animation-duration: |
动画 | 引用的动画名 | 动画循环总数 | 动画持续时间 |
animation-direction:alternate | animation-direction:normal | animation-timing-function:ease-in | @media |
轮流反向播放 | 正常播放 | 播放速度:慢-快 | 媒体查询 |
@meia screen | orientation:portrait | orientation:landscape | diplay-flex |
查询屏幕信息 | 竖屏 | 横屏 | 弹性布局 |
flex | |||
flex控制参数 |
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
color:linear-gradient(top,#ff0 0%,#f00 100%);
-moz-color:linear-gradient(top,#ff0 0%,#f00 100%);
-wedkit-color:linear-gradient(top,#ff0 0%,#f00 100%);
box-shadow:10px 10px 5px #000;
( 左右 上下 模糊度 颜色 ) box-shadow:10px 10px 5px rgba();
//设置一个名为"go"的动画模式.
@keyframes go {
0% {
left:0;
}
50% {
left:100px;
}
100% {
lefi:250px;
}
}
//只要在用animation-name:引用设定好的动画的名字(如go)即可.
.div {
animation-name: go;
animation-duration: 1s;
animation-iteration:count: 4;
animation-direction:alternate;
animation-timing-function: ease-in-out;
/* 可简写:animation: go 1s 4 alternate ease-in-out; */
}
//查询屏幕在300px以内时{}
@media screen and (max-width: 300px){}
//查询只针对屏幕在640以内和竖屏时(一般用于 iphone4 & 5){}
@media only screen and (max-width:640px) and (orientation:portrait){}
//查询设备宽度在375px以上667px以内且设备像素比率为2(一般用于 iphone6)
@media (min-device-width:375px) and (max-device-width:667px) and (-webkit-min-device-pixel-ratio:2){}
//查询设备宽度在414px以上736px以内且设备像素比率为3(一般用于 iphone6plus)
@media (min-device-width:414px) and (max-divice-width:736px) and (-webkit-min-device-pixel-ratio:3){}
透明度样式:
opacity:0.85;filter:alpha(opacity=85);-moz-opacity:0.85;-o-opacity:0.85;-webkit-opacity:0.85;
<ul>
标签默认带边距,如需修改:ul{margin:0;padding:0}
position:absolute
单独存在时,作为绝对定位使用;当position:relative
单独存在时,默认相对父级模块作定位。 标签html
<div> |
<body> |
<title> |
<head> |
---|---|---|---|
框架 | 主体 | 标题 | 前言 |
<i> |
<b> |
<em> |
<onclick> |
倾斜 | 加粗 | 强调 | 点击 |
<ol> |
<ul> |
<dl> |
<li> |
有序列表 | 无序列表 | 定义列表 | 列表 |
<dt> |
<dd> |
<table> |
<thead> |
标题 | 内文 | 表格 | 表头 |
<tbody> |
<tr> |
<td> |
<th> |
表格主体 | 行 | 格 | 表头内文 |
<a> |
<p> |
<button> |
<input> |
超链接 | 段落 | 按钮 | 框 |
<marquee> |
<form> |
<div id> |
<div class> |
滚动 | 表单 | 框架名字 | 框架名字 |
<img src> |
<div onmouseover> |
<h1> |
<h6> |
插入图片 | 鼠标点击事件 | 1级标题 | 初级标题 |
<span> |
<type="text"> |
<type="checkbox"> |
<type="radio"> |
群组 | 文本 | 勾选框 | 单选框 |
<label> |
<placeholder> |
<a target="_blank"> |
<type="password"> |
属性牵连 | 占位符提示文本 | 新建页面 | 密码框 |
<subimt> |
<select> |
<opyion> |
  |
提交按钮 | 选择(下拉菜单) | 选项(下拉选项) | 空格 |
<textarea> |
<header> |
<footer> |
<hgroup> |
文本框 | 头部内文 | 尾部内文 | 组合标题 |
<mark> |
<figure> |
<figcaption> |
<small> |
突出标记文本 | 图像图表框 | 字幕说明文字 | 缩小文本 |
<required> |
<autofocus> |
<audio> |
<source> |
必须填写命令 | 自动获取焦点 | 引入音频 | 资源 |
<autoplay> |
<controls> |
<video> |
<preload> |
自动播放 | 创建控制台 | 引入视频 | 视频预缓存 |
<pattern> |
<a target="iframe"> |
<nowrap> |
<meta> |
内文输入规定 | 预览框 | <tb不换行> |
识别页面信息 |
<sup> |
<sub> |
<> |
<> |
上标文本 | 下标文本 |
移动端HTML5识别尺寸:
//标签名="" 内容="宽度等于设备的宽度,
/* 页面首次被显示时,页面按照标准尺寸显示 */
/* 缩放最大值为标准值 */
/* 用户无法缩放页面 */
/* 缩放最小值为标准值 */
<meta name="viewport" content="width=device-width,
pinitial-scale=1.0,
minimun-scale=1.0,
user-scalable=no,
maximun-scale=1.0">
使文本无法选取:
方法1:
<div unselectable="no" onselectstart="return false">
此时你将无法选取我
</div>
方法2:css
div{
//此时所有div中的文本都无法选取;
-webkit-user-select:none;
-moz-user-select:none;
-o-user-select:none;
user-select:none;
}
^ 破解方法 ^ |
---|
导入音频:
<audio autoplay="autoplay" controls="controls">
<source src="" />
</audio>
导入视频:
<video controls preload>
<source src="" />
</video>
伪累选择器CSS3
:href | :visited | :active | :after |
---|---|---|---|
鼠标覆盖 | 以访问 | 已激活 | 最底层 |
:link | :focus | ||
未访问的连接 | 获取焦点时 |