CSS3实现伪对象立体按钮特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 CSS3实现伪对象立体按钮特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

CSS3实现伪对象立体按钮特效代码

HTML代码(index.html):

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]-->
	<head>
		<meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <title>CSS buttons with pseudo-elements</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="CSS buttons with pseudo-elements" />
        <meta name="keywords" content="css, css3, pseudo, buttons, anchor, before, after, web design" />
        <meta name="author" content="Sergio Camalich for Codrops" />
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style1.css" />
		<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    </head>
    <body>
        <div class="container">
			<!-- Codrops top bar -->
            <div class="codrops-top">
                <a href="http://tympanus.net/Tutorials/AnimatedWebBanners/">
                    <strong>&laquo; Previous Demo: </strong>Animated Web Banners With CSS3
                </a>
                <span class="right">
                    <a href="http://tympanus.net/codrops/2012/01/11/css-buttons-using-pseudo-elements/">
                        <strong>Back to the Codrops Article</strong>
                    </a>
                </span>
                <div class="clr"></div>
            </div><!--/ Codrops top bar -->
			<header>
                <h1>CSS <span>buttons</span></h1>
                <h2>using pseudo-elements</h2>
                <nav class="codrops-demos">
					<a class="current" href="index.html">Demo 1</a>
					<a href="index2.html">Demo 2</a>
					<a href="index3.html">Demo 3</a>
					<a href="index4.html">Demo 4</a>
					<a href="index5.html">Demo 5</a>
                <nav>
			</header>
			<section>
                <div id="container_buttons">
                    <p>
                        <a href="#" class="a_demo_one">
                            Click me!
                        </a>
                    </p>
                    <p>
                        <a href="#" class="a_demo_one">
                            Come on, don't be afraid
                        </a>
                    </p>
                    <p>
                        <a href="#" class="a_demo_one">
                            You can make this as wide as you want ;)
                        </a>
                    </p>
                </div>
			</section>
        </div>
    </body>
</html>





HTML代码(index2.html):

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]-->
	<head>
		<meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <title>CSS buttons with pseudo-elements</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="CSS buttons with pseudo-elements" />
        <meta name="keywords" content="css, css3, pseudo, buttons, anchor, before, after, web design" />
        <meta name="author" content="Sergio Camalich for Codrops" />
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/style2.css" />
		<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    </head>
    <body>
        <div class="container">
			<!-- Codrops top bar -->
            <div class="codrops-top">
                <a href="http://tympanus.net/Tutorials/AnimatedWebBanners/">
                    <strong>&laquo; Previous Demo: </strong>Animated Web Banners With CSS3
                </a>
                <span class="right">
                    <a href="http://tympanus.net/codrops/2012/01/11/css-buttons-with-pseudo-elements/">
                        <strong>Back to the Codrops Article</strong>
                    </a>
                </span>
                <div class="clr"></div>
            </div><!--/ Codrops top bar -->
			<header>
                <h1>CSS <span>buttons</span></h1>
                <h2>with pseudo-elements</h2>
                <nav class="codrops-demos">
					<a href="index.html">Demo 1</a>
					<a class="current" href="index2.html">Demo 2</a>
					<a href="index3.html">Demo 3</a>
					<a href="index4.html">Demo 4</a>
					<a href="index5.html">Demo 5</a>
                <nav>
			</header>
			<section>
                <div id="container_buttons">
                    <p>
                        <a href="#" class="a_demo_two">
                            Click me!
                        </a>
                    </p>
                    <p>
                        <a href="#" class="a_demo_two">
                            Come on, don't be afraid
                        </a>
                    </p>
                    <p>
                        <a href="#" class="a_demo_two">
                            You can make this as wide as you want ;)
                        </a>
                    </p>
                </div>
			</section>
        </div>
    </body>
</html>





CSS代码(style1.css):

@charset "UTF-8";/* CSS Document */
/*DEMO 1*/
.a_demo_one{background-color:#3bb3e0;padding:10px;position:relative;font-family:'Open Sans',sans-serif;font-size:12px;text-decoration:none;color:#fff;border:solid 1px #186f8f;background-image:linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-o-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-moz-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-webkit-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-ms-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,rgb(44,160,202)),color-stop(1,rgb(62,184,229)));-webkit-box-shadow:inset 0px 1px 0px #7fd2f1,0px 1px 0px #fff;-moz-box-shadow:inset 0px 1px 0px #7fd2f1,0px 1px 0px #fff;box-shadow:inset 0px 1px 0px #7fd2f1,0px 1px 0px #fff;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;}
.a_demo_one::before{background-color:#ccd0d5;content:"";display:block;position:absolute;width:100%;height:100%;padding:8px;left:-8px;top:-8px;z-index:-1;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:inset 0px 1px 1px #909193,0px 1px 0px #fff;-moz-box-shadow:inset 0px 1px 1px #909193,0px 1px 0px #fff;-o-box-shadow:inset 0px 1px 1px #909193,0px 1px 0px #fff;box-shadow:inset 0px 1px 1px #909193,0px 1px 0px #fff;}
.a_demo_one:active{padding-bottom:9px;padding-left:10px;padding-right:10px;padding-top:11px;top:1px;background-image:linear-gradient(bottom,rgb(62,184,229) 0%,rgb(44,160,202) 100%);background-image:-o-linear-gradient(bottom,rgb(62,184,229) 0%,rgb(44,160,202) 100%);background-image:-moz-linear-gradient(bottom,rgb(62,184,229) 0%,rgb(44,160,202) 100%);background-image:-webkit-linear-gradient(bottom,rgb(62,184,229) 0%,rgb(44,160,202) 100%);background-image:-ms-linear-gradient(bottom,rgb(62,184,229) 0%,rgb(44,160,202) 100%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,rgb(62,184,229)),color-stop(1,rgb(44,160,202)));}

CSS代码(style2.css):

@charset "UTF-8";/* CSS Document */
/*DEMO 2*/
.a_demo_two{background-color:#3bb3e0;padding:10px;position:relative;font-family:'Open Sans',sans-serif;font-size:12px;text-decoration:none;color:#fff;background-image:linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-o-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-moz-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-webkit-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-ms-linear-gradient(bottom,rgb(44,160,202) 0%,rgb(62,184,229) 100%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,rgb(44,160,202)),color-stop(1,rgb(62,184,229)));-webkit-box-shadow:inset 0px 1px 0px #7fd2f1,0px 6px 0px #156785;-moz-box-shadow:inset 0px 1px 0px #7fd2f1,0px 6px 0px #156785;-o-box-shadow:inset 0px 1px 0px #7fd2f1,0px 6px 0px #156785;box-shadow:inset 0px 1px 0px #7fd2f1,0px 6px 0px #156785;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;}
.a_demo_two::before{background-color:#072239;content:"";display:block;position:absolute;width:100%;height:100%;padding-left:2px;padding-right:2px;padding-bottom:4px;left:-2px;top:5px;z-index:-1;-webkit-border-radius:6px;-moz-border-radius:6px;-o-border-radius:6px;border-radius:6px;-webkit-box-shadow:0px 1px 0px #fff;-moz-box-shadow:0px 1px 0px #fff;-o-box-shadow:0px 1px 0px #fff;box-shadow:0px 1px 0px #fff;}
.a_demo_two:active{color:#156785;text-shadow:0px 1px 1px rgba(255,255,255,0.3);background:rgb(44,160,202);-webkit-box-shadow:inset 0px 1px 0px #7fd2f1,inset 0px -1px 0px #156785;-moz-box-shadow:inset 0px 1px 0px #7fd2f1,inset 0px -1px 0px #156785;-o-box-shadow:inset 0px 1px 0px #7fd2f1,inset 0px -1px 0px #156785;box-shadow:inset 0px 1px 0px #7fd2f1,inset 0px -1px 0px #156785;top:7px;}
.a_demo_two:active::before{top:-2px;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
81.80 KB
Html JS 图片特效2
最新结算
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
HTML5实现CSS滤镜图片切换特效代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery+css3实现信封效果
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章