css基础学习(3)(盒子模型,动画)
来源:互联网 发布:ggplot python legend 编辑:程序博客网 时间:2024/06/06 17:20
一个简单的盒子模型框架
boxM.html
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>BoxM</title> <link href="../css/style.css" rel="stylesheet" type="text/css"></head><body> <div class="top"> <div class="top_content"></div> </div> <div class="body"> <div class="body_image"></div> <div class="body_content"> <div class="body_notification"></div> </div> </div> <div class="footer"> <div class="footer_content"></div> <div class="footer_menu"></div> </div></body></html>
style.css
*{ margin: 0px; padding: 0px;}.top{ width: 100%; height: 50px; background-color: #000000;}.top_content{ width: 75%; height: 50px; margin: 0px auto; background-color: #98bf21;}.body{ margin: 20px auto; width: 75%; height: 1500px; background-color: antiquewhite;}.body_image{ width: 100%; height: 400px; background-color: #bebebe;}.body_content{ width: 100%; height: 1100px; background-color: aquamarine;}.body_notification{ width: 100%; height: 50px; background-color: #cc0000;}.footer{ width: 75%; height: 400px; background-color: indigo; margin: 0px auto;}.footer_content{ width: 100%; height: 350px; background-color: darkgreen;}.footer_menu{ width: 100%; height: 50px; background-color: #000000;}
效果图:
动画效果
<style type="text/css"> #divq{ //平移 width: 100px; height: 100px; background-color: #A7C942; transform: translate(200px,100px); //如果浏览器不支持动画,可以设置支持 -webkit-transform:translate(200px,100px);/*safari chrome*/ -ms-transform: translate(200px,100px);/*IE*/ -o-transform: translate(200px,100px);/*opera*/ -moz-transform: translate(200px,100px);/*firefox*/ } #divq{ //旋转 width: 100px; height: 100px; background-color: #A7C942; transform: rotate(180deg); //如果浏览器不支持动画,可以设置支持 -webkit-transform:rotate(180deg);/*safari chrome*/ -ms-transform: rotate(180deg);/*IE*/ -o-transform: rotate(180deg);/*opera*/ -moz-transform: rotate(180deg);/*firefox*/ } #divq{ //缩放 width: 100px; height: 100px; background-color: #A7C942; transform: scale(1,2); //如果浏览器不支持动画,可以设置支持 -webkit-transform:scale(1,2);/*safari chrome*/ -ms-transform: scale(1,2);/*IE*/ -o-transform: scale(1,2);/*opera*/ -moz-transform: scale(1,2);/*firefox*/ } #divq{ width: 100px; height: 100px; background-color: #A7C942; transform: skew(10deg,10deg); //如果浏览器不支持动画,可以设置支持 -webkit-transform:skew(10deg,10deg);/*safari chrome*/ -ms-transform: skew(10deg,10deg);/*IE*/ -o-transform: skew(10deg,10deg);/*opera*/ -moz-transform: skew(10deg,10deg);/*firefox*/ } </style>
demo1:平移
div{ width: 100px; height: 100px; background-color: red; position: relative; animation: anim 5s;/*animation: anim 5s infinite alternate*/ -webkit-animation: anim 5s;}@keyframes anim { 0%{background: red;left: 0px;top:0px} 25%{background: blue;left: 200px;top:0px} 50%{background: #ccffcc;left: 200px;top:200px} 75%{background: #00ffff;left: 0px;top:200px} 100%{background: red;left: 0px;top:0px}}@-webkit-keyframes anim { 0%{background: red;left: 0px;top:0px} 25%{background: blue;left: 200px;top:0px} 50%{background: #ccffcc;left: 200px;top:200px} 75%{background: #00ffff;left: 0px;top:200px} 100%{background: red;left: 0px;top:0px}}
demo2:旋转
div{ width: 100px; height: 100px; background-color: blue; -webkit-transition: width 2s ,height 2s,-webkit-transform 2s; transition: width 2s,height 2s,transform 2s;}#div1:hover{ width: 200px; height: 200px; transform:rotate(360deg); -webkit-transform: rotate(360deg);}
demo3:多列
.div1{ column-count: 3; -webkit-column-count: 3; -webkit-column-gap: 30px; column-gap: 30px; column-rule: 5px outset #ff0000; -webkit-column-rule: 5px outset #ff0000;}
0 0
- css基础学习(3)(盒子模型,动画)
- CSS 基础(003_盒子模型)
- css盒子模型(3)
- css(盒子模型)
- HTML5:学习(5)CSS盒子模型
- CSS学习3-盒子模型
- CSS基础学习十三:盒子模型
- css基础,盒子模型
- HTML基础笔记之CSS盒子模型1(布局)
- html和css基础(五)盒子模型
- CSS — (盒子模型)
- Css3盒子模型-css学习之旅(5)
- 初学者之CSS学习(六)盒子模型
- CSS基础之盒子模型
- 【CSS 基础】06 盒子模型
- CSS基础-18CSS盒子模型-盒子模型应用
- HTML基础学习-20- div css容器 盒子模型学习3
- CSS学习笔记----盒子模型
- iOS 运行时应用
- Timer类--计时器
- 红黑树(二)之 C语言的实现
- [Java并发包学习三]ThreadFactory介绍
- Python3.5.2学习之旅---IO
- css基础学习(3)(盒子模型,动画)
- 快速排序
- 电力通信网体系结构
- Data Files ----odoo9
- 一些程序段分析(2)
- c++内存对齐的问题
- 数据结构也不是那么没意思之中序二叉树+二叉树转伪双向循环链表
- HDU1421 搬寝室(DP)
- matlab_struct