文章目录
HTML5
语义化标签,本地存储,视频,音频…
1. HTML5新增标签
<!-- 语义化标签 -->
<header>头部</header>
<nav>导航</nav>
<article>
文章 页面中有一块独立的内容区域 放标签
</article>
<footer>底部</footer>
<aside>侧边栏</aside>
<section>内容</section>
2. 表单属性–交互表单属性
<form action="">
<p>邮箱:<input type="email" required placeholder="提示文字"></p>
<p>地址:<input type="url" name="" id="" autofocus></p>
<p>日期<input type="date" name="" id=""></p>
<p>时间<input type="time" name="" id=""></p>
<p>月<input type="month" name="" id=""></p>
<p>周<input type="week" name="" id=""></p>
<p>数字<input type="number" name="" id=""></p>
<p>电话<input type="tel" name="" id=""></p>
<p>搜索<input type="search" name="" id=""></p>
<p>颜色<input type="color" name="" id=""></p>
</form>
required 必填
placeholder 提示文字
autofocus 自动获取焦点
CSS3
选择器 属性 过渡 动画 平移 3d空间 边框…
1. 选择器
1.1 属性选择器
E[attr] 标签名[属性]{}
E[attr="value"] 标签名[属性名=属性值]{}
E[attr^="value"] 标签名[type^='t'] 选中有type属性的,属性值以t开头的标签
E[attr$="value"] 标签名[type$='t'] 选中有type属性的,属性值以t结尾的标签
1.2 结构伪类选择器
first-child
last-child
nth-child(n) even odd -n+3 3n
1.3 伪元素选择器
::before
::after
-------------
1:伪元素 content属性必不可少
2:必须依附于真正的元素 (标签+内容)
3:after显示在内容最后边 before显示内容的最前边
4:伪元素具有行内元素的特点
2. css属性
2.1 平面转换transform
改变盒子在平面内的形态(位移,旋转,缩放)
2.1.1 平移
transform:translate(水平移动距离,垂直移动距离)
取值: (正负都可以)
1:像素单位数值
2:百分比(参照物盒子自身的尺寸)
x轴正向为右,y轴正向为下
translate如果只给出一个值,表示x轴方向移动距离
单独设置某个方向的移动距离 translateX 和 translateY
<!DOCTYPE html>
<html>
<head>
<style>
.father{
width: 500px;
height: 300px;
margin: 100px auto;
border: 1px solid #000;
}
.son{
width: 200px;
height: 100px;
background-color: pink;
/* 过渡 */
transition: all 1s;
}
.father:hover .son{
/* transform: translate(100px,50px); */
/* 百分比:盒子自身尺寸的百分比 */
/* transform: translate(100%,50%); */
/* transform: translate(-100%,-50%); */
/* 只给出一个值 x轴移动距离 */
/* transform: translate(100px); */
transform: translateY(100px);
}
</style>
</head>
<body>
<div class="father">
<div class="son">