实现3D旋转动画(纯html5技术实现)
参考实例:http://www.html5tricks.com/demo/3d-html5-logo/index.html
实现超酷3D CSS3菜单
参考实例:http://www.html5tricks.com/demo/css3-ribbon-menu-1/index.html
效果图:
下面我们来一起看看实现这款CSS3飘带菜单的具体过程以及源代码。源码主要由HTML代码和CSS代码组成,还比较简单。
HTML代码:
<div class=’ribbon’>
<a href=’#'><span>Home</span></a>
<a href=’#'><span>About</span></a>
<a href=’#'><span>Services</span></a>
<a href=’#'><span>Contact</span></a>
</div>
看HTML代码非常简单,几个a标签就把菜单的结构描述清楚了,当然主要还是看CSS代码。
CSS代码:
.ribbon {
display:inline-block;
}.ribbon:after, .ribbon:before {
margin-top:0.5em;
content: “”;
float:left;
border:1.5em solid #fff;
}.ribbon:after {
border-right-color:transparent;
}.ribbon:before {
border-left-color:transparent;
}.ribbon a:link, .ribbon a:visited {
color:#000;
text-decoration:none;
float:left;
height:3.5em;
overflow:hidden;
}.ribbon span {
background:#fff;
display:inline-block;
line-height:3em;
padding:0 1em;
margin-top:0.5em;
position:relative;-webkit-transition: background-color 0.2s, margin-top 0.2s; /* Saf3.2+, Chrome */
-moz-transition: background-color 0.2s, margin-top 0.2s; /* FF4+ */
-ms-transition: background-color 0.2s, margin-top 0.2s; /* IE10 */
-o-transition: background-color 0.2s, margin-top 0.2s; /* Opera 10.5+ */
transition: background-color 0.2s, margin-top 0.2s;
}.ribbon a:hover span {
background:#FFD204;
margin-top:0;
}.ribbon span:before {
content: “”;
position:absolute;
top:3em;
left:0;
border-right:0.5em solid #9B8651;
border-bottom:0.5em solid #fff;
}.ribbon span:after {
content: “”;
position:absolute;
top:3em;
right:0;
border-left:0.5em solid #9B8651;
border-bottom:0.5em solid #fff;
}
这里我们又一次应用了CSS3的:before和:after伪类对象,设置了菜单项前后的内容,并做了样式渲染,实现了鼠标滑过菜单项出现凸起的立体效果。
3. 自定义HTML5视频播放器外观
参考实例:http://www.html5tricks.com/demo/video-js/demo.html
效果图:
4. HTML5树叶飘落动画(基于webkit浏览器)
参考实例:http://www.html5tricks.com/demo/css3-fall-leaves/index.html
效果图:
5. CSS3图片层叠切换动画
参考实例:http://www.html5tricks.com/demo/css3-fold-p_w_picpath-slider/index.html
效果图:
6. CSS3图片左右切换弹性动画
参考实例:http://www.html5tricks.com/demo/html5-css3-elasticity/index.html
效果图:
7. CSS3鼠标悬停动画按钮
参考实例:http://www.html5tricks.com/demo/css3-hover-button-animation/index.html
效果图:
8. CSS3鼠标悬停动画菜单按钮
参考实例:http://www.html5tricks.com/demo/css3-hover-button-animation/index.html
效果图:
9. CSS3垂直手风琴折叠菜单
参考实例:http://www.html5tricks.com/demo/css3-ver-accordion-menu/index.html
效果图:
10. CSS3图片倾斜效果,可倾斜4个角度
参考实例:http://www.html5tricks.com/demo/css3-p_w_picpath-tilt-effect/index.html
效果图:
11. CSS3图片洗牌切换动画特效
参考实例:http://www.html5tricks.com/demo/jquery-css3-p_w_picpath-switch/index.html
效果图:
12. jQuery/CSS3图片翻转特效,可水平垂直翻转
参考实例:http://www.html5tricks.com/demo/jquery-css3-p_w_picpath-rotate/index.html
效果图:
13. HTML5/CSS3一组可爱的3D按钮
参考实例:http://www.html5tricks.com/demo/html5-css3-pretty-button/index.html#
效果图:
转载于:https://blog.51cto.com/806461/1815281