[关闭]
@File 2019-10-08T11:17:40.000000Z 字数 4689 阅读 136

html+css

web


CSS识别格式

  • <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控制参数
  1. box-sizing的用法:(和outline效果一样)
    box-sizing:border-box;
    -moz-box-sizing:border-box; /* Firefox */
    -webkit-box-sizing:border-box; /* Safari */
  2. linear-gradient的用法:( 方向 , 颜色 位置 , 颜色 位置 )
    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%);
  3. box-shadow的用法:(通用于text-shadow)
    box-shadow:10px 10px 5px #000; ( 左右 上下 模糊度 颜色 )
    box-shadow:10px 10px 5px rgba();
  4. animation的使用方法:
  1. //设置一个名为"go"的动画模式.
  2. @keyframes go {
  3. 0% {
  4. left:0;
  5. }
  6. 50% {
  7. left:100px;
  8. }
  9. 100% {
  10. lefi:250px;
  11. }
  12. }
  13. //只要在用animation-name:引用设定好的动画的名字(如go)即可.
  14. .div {
  15. animation-name: go;
  16. animation-duration: 1s;
  17. animation-iteration:count: 4;
  18. animation-direction:alternate;
  19. animation-timing-function: ease-in-out;
  20. /* 可简写:animation: go 1s 4 alternate ease-in-out; */
  21. }
  1. //查询屏幕在300px以内时{}
  2. @media screen and (max-width: 300px){}
  3. //查询只针对屏幕在640以内和竖屏时(一般用于 iphone4 & 5){}
  4. @media only screen and (max-width:640px) and (orientation:portrait){}
  5. //查询设备宽度在375px以上667px以内且设备像素比率为2(一般用于 iphone6)
  6. @media (min-device-width:375px) and (max-device-width:667px) and (-webkit-min-device-pixel-ratio:2){}
  7. //查询设备宽度在414px以上736px以内且设备像素比率为3(一般用于 iphone6plus)
  8. @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;

1. 定位属性position用法


标签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> &nbsp
提交按钮 选择(下拉菜单) 选项(下拉选项) 空格
<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识别尺寸:

  1. //标签名="" 内容="宽度等于设备的宽度,
  2. /* 页面首次被显示时,页面按照标准尺寸显示 */
  3. /* 缩放最大值为标准值 */
  4. /* 用户无法缩放页面 */
  5. /* 缩放最小值为标准值 */
  6. <meta name="viewport" content="width=device-width,
  7. pinitial-scale=1.0,
  8. minimun-scale=1.0,
  9. user-scalable=no,
  10. maximun-scale=1.0">

使文本无法选取:
方法1:

  1. <div unselectable="no" onselectstart="return false">
  2. 此时你将无法选取我
  3. </div>

方法2:css

  1. div{
  2. //此时所有div中的文本都无法选取;
  3. -webkit-user-select:none;
  4. -moz-user-select:none;
  5. -o-user-select:none;
  6. user-select:none;
  7. }
^ 破解方法 ^

导入音频:

  1. <audio autoplay="autoplay" controls="controls">
  2. <source src="" />
  3. </audio>

导入视频:

  1. <video controls preload>
  2. <source src="" />
  3. </video>

伪累选择器CSS3

:href :visited :active :after
鼠标覆盖 以访问 已激活 最底层
:link :focus
未访问的连接 获取焦点时
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注