超链接hover切换效果

<!DOCTYPE html>
<html>
        <head>
                <meta charset="UTF-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
                <title>css3制作经验hover切换效果</title>
                <style type="text/css">
                        body, html {
                                margin:0; padding:0; overflow:hidden; height:100%; width:100%; background:orange; font-size:12px;
                        }
                        .clear {
                                clear:both;
                        }
                        .container {
                                width:100px; height:100px; position:relative; overflow:hidden; text-shadow:0px 0px 5px orange; text-align:center; line-height:100px; font-size:2rem; float:left; margin-left:20px; margin-top:20px;
                        }
                        .container .before, .container .after {
                                width:100%; height:100%; border-radius:50%; position:absolute; top:0px; left:0px; transition-duration:0.35s; -webkit-transition-duration:0.35s;  -moz-transition-duration:1s; -o-transition-duration:1s;
                        }
                        /*默认行为*/
                        .container .before {
                                background:white; left:0px; color:black;
                        }
                        .container .after {
                                background:black; left:100%; color:#fff;
                        }
                        .container:hover .before {
                                left:-100%;
                        }
                        .container:hover .after {
                                left:0%;
                        }
                        /*demo1 由左而右*/
                        .container.demo1 .before {
                                left:0px;
                        }
                        .container.demo1 .after {
                                left:-100%;
                        }
                        .container.demo1:hover .before {
                                left:100%;
                        }
                        .container.demo1:hover .after {
                                left:0%;
                        }
                        /*demo2 由上而下*/
                        .container.demo2 .before {
                                left:0px;
                        }
                        .container.demo2 .after {
                                top:-100%; left:0px;
                        }
                        .container.demo2:hover .before {
                                top:100%; left:0px;
                        }
                        .container.demo2:hover .after {
                                top:0%;
                        }
                        /*demo3 由下而上*/
                        .container.demo3 .before {
                                left:0px;
                        }
                        .container.demo3 .after {
                                top:100%; left:0px;
                        }
                        .container.demo3:hover .before {
                                top:-100%; left:0px;
                        }
                        .container.demo3:hover .after {
                                top:0%;
                        }
                        /*demo4 扁的由下而上*/
                        .container.demo4 .before {
                                left:0px;
                        }
                        .container.demo4 .after {
                                top:100%; left:0px;
                        }
                        .container.demo4:hover .before {
                                height:0px;
                        }
                        .container.demo4:hover .after {
                                top:0%;
                        }
                        /*demo5 扁的由上而下*/
                        .container.demo5 .before {
                                left:0px;
                        }
                        .container.demo5 .after {
                                top:-100%; left:0px;
                        }
                        .container.demo5:hover .before {
                                height:0px; top:100%;
                        }
                        .container.demo5:hover .after {
                                top:0%;
                        }
                        /*demo6 扁的由左而右*/
                        .container.demo6 .before {
                                left:0px;
                        }
                        .container.demo6 .after {
                                top:0%; left:-100%;
                        }
                        .container.demo6:hover .before {
                                width:0px; left:100%;
                        }
                        .container.demo6:hover .after {
                                left:0%;
                        }
                        /*demo7 扁的由右而左*/
                        .container.demo7 .before {
                                left:0px;
                        }
                        .container.demo7 .after {
                                top:0%; left:100%;
                        }
                        .container.demo7:hover .before {
                                width:0px;
                        }
                        .container.demo7:hover .after {
                                left:0%;
                        }
                        /*demo8 */
                        .container.demo8 .before {
                                left:0px;
                        }
                        .container.demo8 .after {
                                left:0%; -webkit-transform:scale(0);
                        }
                        .container.demo8:hover .before {
                                -webkit-transform:scale(0);
                        }
                        .container.demo8:hover .after {
                                -webkit-transform:scale(1);
                        }
                        /*demo9 */
                        .container.demo9 .before {

                        }
                        .container.demo9 .after {
                                top:100%; left:100%;
                        }
                        .container.demo9:hover .before {
                                width:0%; height:0%;
                        }
                        .container.demo9:hover .after {
                                left:0%; top:0%;
                        }
                        /*demo10 */
                        .container.demo10 .before {

                        }
                        .container.demo10 .after {
                                top:100%; left:-100%;
                        }
                        .container.demo10:hover .before {
                                width:0%; height:0%;
                        }
                        .container.demo10:hover .after {
                                left:0%; top:0%;
                        }
                        /*demo11 */
                        .container.demo11 .before {

                        }
                        .container.demo11 .after {
                                top:-100%; left:-100%;
                        }
                        .container.demo11:hover .before {
                                width:0%; height:0%;
                        }
                        .container.demo11:hover .after {
                                left:0%; top:0%;
                        }
                        /*demo12 */
                        .container.demo12 .before {

                        }
                        .container.demo12 .after {
                                top:-100%; left:100%;
                        }
                        .container.demo12:hover .before {
                                width:0%; height:0%;
                        }
                        .container.demo12:hover .after {
                                left:0%; top:0%;
                        }
                </style>
        </head>
        <body>
                <div class="clear">
                        <div class="container">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo1">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo2">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo3">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                </div>
                <!--第二行-->
                <div class="clear" >
                        <div class="container demo4">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo5">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo6">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo7">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                </div>
                <div class="clear">
                        <div class="container demo8">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                </div>
                <div class="clear">
                        <div class="container demo9">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo10">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo11">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                        <div class="container demo12">
                                <div class="before">
                                        hui52
                                </div>
                                <div class="after">
                                        hui52
                                </div>
                        </div>
                </div>
        </body>
</html>

笔记链接:http://www.w3cfuns.com/blog-5460917-5403445.html

时间: 2024-11-02 11:51:14

超链接hover切换效果的相关文章

css3制作惊艳hover切换效果

css3制作经验hover切换效果 <!DOCTYPE html><html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"&g

CSS如何实现超链接背景切换

CSS如何实现超链接背景切换:建议:尽可能的手写代码,可以有效的提高学习效率和深度. 相当数量的网站在导航栏都有如此效果:当鼠标放在导航栏目上,背景图片会发生变化,移开之后又会还原原来的背景图片.下面简单介绍一下如何实现此效果.代码实例如下: <!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content=&quo

鼠标经过图标切换效果

我们对于鼠标经过图标切换效果这个神奇效果并不陌生,那么怎么用代码实现呢? html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <

搞定tab标签切换效果

<!doctype html><html lang="en"><head>    <meta charset="UTF-8">    <title>搞定tab标签切换效果</title><style>*{ margin:0; padding:0;list-style: none;}body {font:12px/1.5 Tahoma;}#big{border: 1px solid b

网站——循环图片切换效果(最近做网站,已经快炸了)

看一下效果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn"><head><meta

jquery实现简单的导航栏切换效果($(this).index)

一个简单的导航栏切换效果的制作,主要通过索引值和jquery的siblings()来实现 html代码: <div class="container"> <ul class="top-nav"> <li class="nav">html</li> <li class="nav">css</li> <li class="nav"&g

导航条点击按钮切换效果

<!--[if IE]><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><![endif]--><html xmlns="http://www.w3.org/1999/xhtml"><head>&

用html+css+js实现选项卡切换效果

文章转载自:http://tongling.github.io/JSCards/ 用html+css+js实现选项卡切换效果 使用之前学过的综合知识,实现一个新闻门户网站上的常见选项卡效果: 文字素材: 房产: 275万购昌平邻铁三居 总价20万买一居 200万内购五环三居 140万安家东三环 北京首现零首付楼盘 53万购东5环50平 京楼盘直降5000 中信府 公园楼王现房 家居: 40平出租屋大改造 美少女的混搭小窝 经典清新简欧爱家 90平老房焕发新生 新中式的酷色温情 66平撞色活泼家居

jquery带按钮的图片切换效果

<!doctype html> <html> <head> <meta charset="gb2312"> <title>jquery带按钮的图片切换效果</title> <script type="text/javascript" src="jquery-1.8.0.js"></script> <style type="text/cs