CSS3实现页面的平滑过渡
这是文件的css,全部文件的话请到Github下载:点击这里
@charset "UTF-8";
@font-face {font-family: 'iconfont';
src: url('font/iconfont.eot'); /* IE9*/
src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('font/iconfont.woff') format('woff'), /* chrome、firefox */
url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('font/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
font-weight: normal; /*设置字体宽度和字体样式*/
font-style:normal;
}
body{
font-family:Georia,serif;
background:#ddd;
font-weight:;
font-size:15px;
color:#333;
overflow:hidden;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
a{
text-decoration:none;
color:#555;;
}
.clr{ /*清除浮动*/
width:;
height:;
overflow:hidden;
clear:both;
padding:;
margin:;
}
.st-container{
width:100%;
height:100%;
position:absolute;
left:;
top:;
font-family: "Josefin Slab","Myriad Pro",Arial,sans-serif;
}
.st-container > input,
.st-container > a{
width:20%;
height:34px;
line-height: 34px;
position:fixed;
bottom:; }
.st-container > input{
opacity:;
z-index:;
cursor:pointer;
}
.st-container > a {
z-index:;
font-weight:;
font-size:16px;
background:#b032da;
text-align:center;
color:#fff;
text-shadow:1px 1px 1px rgba(151,24,64,0.2);
}
#st-control-1,#st-control-1+a{
left:0%;
}
#st-control-2,#st-control-2+a{
left:20%;
}
#st-control-3,#st-control-3+a{
left:40%;
}
#st-control-4,#st-control-4+a{
left:60%;
}
#st-control-5,#st-control-5+a{
left:80%;
}
.st-container input:checked+a,
.st-container input:checked:hover+a{
background:#792c92;/*使当前选择的input后面的a显示深紫色,并且当鼠标移过的时候不会改变颜色*/
}
.st-container input:checked+a:after{/*在当前选择的input后面的a下添加小三角形*/
content:"";
width:;
height:;
overflow: hidden;
border:20px solid transparent;
border-bottom-color:#792c92;
position:absolute;
bottom:100%;
left:50%;/*居中*/
margin-left:-20px;
}
.st-container input:hover + a{
background:#cc69ed;/*底部达到hover变成淡紫红色的效果*/
} .st-scroll,
.st-panel{
width:100%;
height:100%;
position: relative;
}
.st-scroll{
left:;
top:;
-webkit-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
-o-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
-webkit-backface-visibility:hidden;
-webkit-transition: all 0.6s ease-in-out;
-o-transition: all 0.6s ease-in-out;
transition: all 0.6s ease-in-out;
}
.st-panel{
background:#fff;
overflow: hidden;
}
#st-control-1:checked ~ .st-scroll{
-webkit-transform: translateY(0%);
-ms-transform: translateY(0%);
-o-transform: translateY(0%);
transform: translateY(0%);/*火狐已经实现transform这个属性,所以没有前缀了*/
}
#st-control-2:checked ~ .st-scroll{
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
-o-transform: translateY(-100%);
transform: translateY(-100%);
}
#st-control-3:checked ~ .st-scroll{
-webkit-transform: translateY(-200%);
-ms-transform: translateY(-200%);
-o-transform: translateY(-200%);
transform: translateY(-200%);
}
#st-control-4:checked ~ .st-scroll{
-webkit-transform: translateY(-300%);
-ms-transform: translateY(-300%);
-o-transform: translateY(-300%);
transform: translateY(-300%);
}
#st-control-5:checked ~ .st-scroll{
-webkit-transform: translateY(-400%);
-ms-transform: translateY(-400%);
-o-transform: translateY(-400%);
transform: translateY(-400%);
}
.st-desc{
width:200px;
height:200px;
background:#8c3da6;
position: absolute;
left:50%;
top:;
margin-left:-100px;
-webkit-transform: translateY(-50%) rotate(45deg);
-ms-transform: translateY(-50%) rotate(45deg);
-o-transform: translateY(-50%) rotate(45deg);
transform: translateY(-50%) rotate(45deg);
}
[data-icon]:after{
content:attr(data-icon); /*内容为data-icon属性的值*/
width:200px;
height:200px;
color:#fff;
font-size:90px;/*字体图标的大小*/
text-align: center;
line-height: 200px;
position: absolute;
left:50%;
top:50%;
margin:-100px 0 0 -100px;
-webkit-transform: rotate(-45deg) translateY(25%);
-ms-transform: rotate(-45deg) translateY(25%);
-o-transform: rotate(-45deg) translateY(25%);
transform: rotate(-45deg) translateY(25%); font-family:"iconfont" !important; /*覆盖原来设置的字体*/
font-size:50px; /*字体大小*/
font-style:normal;
-webkit-font-smoothing: antialiased; /*字体平滑*/
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
text-shadow:3px 3px 1px rgba(151,24,64,0.2);
}
.st-panel h2{
color:#b032da;
font-size:54px;
line-height: 50px;
text-align: center;
font-weight:;
width:80%; /*宽度设置为100%,left0%也可以居中*/
position: absolute;
left:10%;
top:50%;
margin-top:-70px;
text-shadow: 1px 1px 1px rgba(151,24,64,0.2);
-webkit-backface-visibility:hidden; /*?什么用*/
}
#st-control-1:checked ~ .st-scroll #st-panel-1 h2,
#st-control-2:checked ~ .st-scroll #st-panel-2 h2,
#st-control-3:checked ~ .st-scroll #st-panel-3 h2,
#st-control-4:checked ~ .st-scroll #st-panel-4 h2,
#st-control-5:checked ~ .st-scroll #st-panel-5 h2{/*bakcwards表示动画默认开始执行,但是0.2S设置了延迟播放时间*/
-webkit-animation:moveDown 0.6s ease-in-out 0.2s backwards;
-moz-animation:moveDown 0.6s ease-in-out 0.2s backwards;
-ms-animation:moveDown 0.6s ease-in-out 0.2s backwards;
-o-animation:moveDown 0.6s ease-in-out 0.2s backwards;
animation:moveDown 0.6s ease-in-out 0.2s backwards;
}
@-webkit-keyframes moveDown{ /*关键帧*/
0%{
-webkit-transform:translateY(-40px);
transform: translateY(-40px);
opacity:;
}
100%{
-webkit-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-moz-keyframes moveDown{ /*关键帧*/
0%{
-moz-transform:translateY(-40px);
transform: translateY(-40px);
opacity:;
}
100%{
-moz-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-ms-keyframes moveDown{ /*关键帧*/
0%{
-ms-transform:translateY(-40px);
transform:translateY(-40px);
opacity:;
}
100%{
-ms-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-o-keyframes moveDown{ /*关键帧*/
0%{
-o-transform:translateY(-40px);
transform:translateY(-40px);
opacity:;
}
100%{
-o-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@keyframes moveDown{ /*关键帧*/
0%{
transform:translateY(-40px);
opacity:;
}
100%{
transform:translateY(0px);
opacity:;
}
}
.st-panel p{
position: absolute;
width:50%;
left:25%;
top:50%;
font-size:16px;
line-height: 22px;
padding:;
text-align: center;
backface-visibility:hidden;
color:#8b8b8b;
margin-top:10px;
}
#st-control-1:checked ~ .st-scroll #st-panel-1 p,
#st-control-2:checked ~ .st-scroll #st-panel-2 p,
#st-control-3:checked ~ .st-scroll #st-panel-3 p,
#st-control-4:checked ~ .st-scroll #st-panel-4 p,
#st-control-5:checked ~ .st-scroll #st-panel-5 p{/*bakcwards表示动画默认开始执行,但是0.2S设置了延迟播放时间*/
-webkit-animation:moveUp 0.6s ease-in-out 0.2s backwards;
-moz-animation:moveUp 0.6s ease-in-out 0.2s backwards;
-ms-animation:moveUp 0.6s ease-in-out 0.2s backwards;
-o-animation:moveUp 0.6s ease-in-out 0.2s backwards;
animation:moveUp 0.6s ease-in-out 0.2s backwards;
}
@-webkit-keyframes moveUp{
0%{
-webkit-transform:translateY(40px);
transform:translateY(40px);
opacity:;
}
100%{
-webkit-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-moz-keyframes moveUp{
0%{
-moz-transform:translateY(40px);
transform:translateY(40px);
opacity:;
}
100%{
-moz-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-ms-keyframes moveUp{
0%{
-ms-transform:translateY(40px);
transform:translateY(40px);
opacity:;
}
100%{
-ms-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@-o-keyframes moveUp{
0%{
-o-transform:translateY(40px);
transform:translateY(40px);
opacity:;
}
100%{
-o-transform:translateY(0px);
transform:translateY(0px);
opacity:;
}
}
@keyframes moveUp{
0%{
transform:translateY(40px);
opacity:;
}
100%{
transform:translateY(0px);
opacity:;
}
}
.st-color{
background:#CC69ED;
}
.st-color .st-desc{
background:#fff;
}
.st-color [data-icon]:after{
color:#CC69ED;
}
.st-color h2{
color:#fff;
text-shadow:1px 1px 1px rgba(0,0,0,0.1);
}
.st-color p{
color:rgba(255,255,255,0.8);
}
/*移动设备自适应*/
@media screen and(max-width:520px){
.st-panel h2{
font-size:42px;
}
.st-panel p{
width:90%;
left:10%;
margin-top:;
}
.st-container > a{
font-size:13px;
}
}
@media screen and(max-width:360px){
.st-panel h2{
font-size:42px;
}
.st-container > a{
font-size:10px;
}
.st-desc{
width:120px;
height:120px;
margin-left:-60px;
}
[data-icon]:after{
font-size:60px;
-webkit-transform: rotate(-45deg) translateY(25%);
-ms-transform: rotate(-45deg) translateY(25%);
-o-transform: rotate(-45deg) translateY(25%);
transform: rotate(-45deg) translateY(25%);
} }
CSS3实现页面的平滑过渡的更多相关文章
- Android实现真正的ViewPager【平滑过渡】+【循环滚动】!!!顺带还有【末页跳转】。
实现真正的ViewPager[平滑过渡]+[循环滚动]!!!顺带还有[末页跳转]. 首先呢, 我要对网上常见的3种ViewPager的循环滚动方法做个概述.急需看真正实现方法的同志请选择性忽略下面这一 ...
- js实现网页全屏切换(平滑过渡),鼠标滚动切换
实现效果为页面平滑过渡全屏切换,点击导航和鼠标滚动都可以切换. 效果图: html代码: <!DOCTYPE html> <html> <head lang=" ...
- CSS3与页面布局学习总结(八)——浏览器兼容与前端性能优化
一.浏览器兼容 1.1.概要 世界上没有任何一个浏览器是一样的,同样的代码在不一样的浏览器上运行就存在兼容性问题.不同浏览器其内核亦不尽相同,相同内核的版本不同,相同版本的内核浏览器品牌不一样,各种运 ...
- CSS3与页面布局学习总结(四)——页面布局大全
一.负边距与浮动布局 1.1.负边距 所谓的负边距就是margin取负值的情况,如margin:-100px,margin:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见的功能 ...
- 纯css3手机页面图标样式代码
全部图标:http://hovertree.com/texiao/css/19/ 先看效果: 或者点这里:http://hovertree.com/texiao/css/19/hoverkico.ht ...
- CSS3与页面布局学习笔记(四)——页面布局大全(负边距、双飞翼、多栏、弹性、流式、瀑布流、响应式布局)
一.负边距与浮动布局 1.1.负边距 所谓的负边距就是margin取负值的情况,如margin:-100px,margin:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见的功能 ...
- CSS3与页面布局学习笔记(八)——浏览器兼容性问题与前端性能优化方案
一.浏览器兼容 1.1.概要 世界上没有任何一个浏览器是一样的,同样的代码在不一样的浏览器上运行就存在兼容性问题.不同浏览器其内核亦不尽相同,相同内核的版本不同,相同版本的内核浏览器品牌不一样,各种运 ...
- css3中动画(transition)和过渡(animation)详析
css3中动画(transition)和过渡(animation)详析
- CSS3与页面布局学习总结(四)——页面布局大全BFC、定位、浮动、7种垂直居中方法
目录 一.BFC与IFC 1.1.BFC与IFC概要 1.2.如何产生BFC 1.3.BFC的作用与特点 二.定位 2.2.relative 2.3.absolute 2.4.fixed 2.5.z- ...
随机推荐
- http压力测试
一.http_load程序非常小,解压后也不到100Khttp_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载.但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把 ...
- NSAttributedString之设置字间距与行间距
// 调整行间距 NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithSt ...
- ios 将Log日志重定向输出到文件中保存
对于真机,日志没法保存,不好分析问题.所以有必要将日志保存到应用的Docunment目录下,并设置成共享文件,这样才能取出分析. 首先是日志输出,分为c的printf和标准的NSLog输出,print ...
- UIButton setImage setBackgoundImage
setBackgroundImage 会根据button的大小平铺 setImage不会平铺
- Django ajax MYSQL Highcharts<1>
Another small project with django/Ajax/Mysql/Highcharts. 看下效果图 - delivery dashboard .嘿嘿 是不是还蛮好看的. 废 ...
- 微软职位内部推荐-SDEII for Windows Phone Apps
微软近期Open的职位: Job title: Software Design Engineer II Location: China, Beijing Division: Operations Sy ...
- 局域网内Tomcat服务器没法访问
多半是防火墙的问题,在server2008上打开防火墙设置,关闭即可访问,不关闭的访问方式暂时好没研究出来
- linux查看有哪些shell可用
1.命令cat /etc/shells [tansheng@localhost ~]$ cat /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/das ...
- 字符串比较 忽略大小写 iphone
//不考虑大小写比较字符串1 NSString *astring01 = @"this is a String!"; NSString *astring02 = @"Th ...
- NABC需求分析
我们团队项目为7-magic,在这个七巧板项目中,我们团队的这个项目有许多的特点,我就其中的一个特点:用户可以自主的用七巧板设计自己想象出的图形,并与大家分享. N (Need 需求): 你的创意解决 ...