前端3D立体功能按钮CSS3按钮

linux vim前端开发环境 ubuntu前端开发环境搭建 web前端开发运行环境

html 代码

<!DOCTYPE html>
<head>
    <meta charset=”UTF-8″>
    <title>HTML5/CSS3 3D立体功能按钮在线演示</title>
    <style>
        .screen-reader-text {
position: absolute;
top: -9999px;
left: -9999px;
}
@font-face {
font-family: ‘fontello’;
src: url(‘http://css-tricks.com/examples/RoundButtons/fonts/fontello.eot’);
src: url(‘http://css-tricks.com/examples/RoundButtons/fonts/fontello.eot?#iefix’) format(’embedded-opentype’),
url(‘http://css-tricks.com/examples/RoundButtons/fonts/fontello.woff’) format(‘woff’),
url(‘http://css-tricks.com/examples/RoundButtons/fonts/fontello.ttf’) format(‘truetype’),
url(‘http://css-tricks.com/examples/RoundButtons/fonts/fontello.svg#fontello’) format(‘svg’);
font-weight: normal; font-style: normal;
}
[class*=”icon-“] {
font-family: ‘fontello’;
font-style: normal;
font-size: 3em;
speak: none;
}
.icon-home:after { content: “\2302”; }
.icon-cog:after { content: “\2699”; }
.icon-cw:after { content: “\27f3”; }
.icon-location:after { content: “\e724”; }
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
background: #f7f7f7url(http://css-tricks.com/examples/RoundButtons/images/bg.png) repeatcentertop;
}
.nav {
list-style: none;
text-align: center;
}
.nav li {
position: relative;
display: inline-block;
margin-right: -4px;
}
.nav li:before {
content: “”;
display: block;
border-top: 1pxsolid#ddd;
border-bottom: 1pxsolid#fff;
width: 100%;
height: 1px;
position: absolute;
top: 50%;
z-index: -1;
}
.nav a:link, .nav a:visited {
display: block;
text-decoration: none;
background-color: #f7f7f7;
background-image: -webkit-gradient(linear, lefttop, leftbottom, from(#f7f7f7), to(#e7e7e7));
background-image: -webkit-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -moz-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -ms-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -o-linear-gradient(top, #f7f7f7, #e7e7e7);
color: #a7a7a7;
margin: 36px;
width: 144px;
height: 144px;
position: relative;
text-align: center;
line-height: 144px;
border-radius: 50%;
box-shadow: 0px3px8px#aaa, inset0px2px3px#fff;
border: solid1pxtransparent;
}
.nav a:before {
content: “”;
display: block;
background: #fff;
border-top: 2pxsolid#ddd;
position: absolute;
top: -18px;
left: -18px;
bottom: -18px;
right: -18px;
z-index: -1;
border-radius: 50%;
box-shadow: inset0px8px48px#ddd;
}
.nav a:active {
box-shadow: none;
border: solid1px#a7a7a7;
}
.nav a:hover {
text-decoration: none;
color: #555;
background: #f5f5f5;
}​
</style>
</head>
<body>
    <nav>
        <ul class=”nav”>
            <li>
                <a href=”#”>
                    <span class=”icon-home”></span>
                    <span class=”screen-reader-text”>Home</span>
                </a>
            </li>
            <li>
                <a href=”#”>
                    <span class=”icon-cog”></span>
                    <span class=”screen-reader-text”>Settings</span>
                </a></li>
            <li>
                <a href=”#”>
                    <span class=”icon-cw”></span>
                    <span class=”screen-reader-text”>Refresh</span>
                </a>
            </li>
            <li>
                <a href=”#”>
                    <span class=”icon-location”></span>
                    <span class=”screen-reader-text”>Location</span>
                </a>
            </li>
        </ul>
    </nav>​
    <div style=”text-align:center;clear:both”>
        <script src=”/gg_bd_ad_720x90.js” type=”text/javascript”></script>
        <script src=”/follow.js” type=”text/javascript”></script>
    </div>
    <script>
/*
From this article:
http://css-tricks.com/circular-3d-buttons/
*/
    </script>
    <style>
        li {
            list-style: none;
        }
        .wrap {
            width: 320px;
            margin: 0 auto;
            font-size: 12px;
            text-align: center;
        }
    </style>
    <body>
        <div class=”wrap”>
            <ul class=”wen”>
                <li>
                    欢迎关注微信公众号:<strong>网页设计自学平台</strong>
                </li>
                <li>
                    <img src=”http://www.51rgb.com/nbbs/data/attachment/forum/201607/25/151650y76hyyq64ffa6yn6.jpg”>
                </li>
            </ul>
        </div>
    </body>
</html>
</body>
</html>

特效说明:一款css制作的拍哦带3D菜单的特效。(兼容测试:IE6及以上、Firefox、Chrome、Opera、Safari、360等主流浏览器)

使用方法:1、调用CSS样式:
<link href=”css/default.css” type=”text/css” rel=”stylesheet”>

2、调用JS插件代码:
<script src=”/gg_bd_ad_720x90.js” type=”text/javascript”></script>
<script src=”/follow.js” type=”text/javascript”></script>
<script src=”js/index.js”></script>

3、添加HTML代码:
将<!–效果html开始–>……<!–效果html结束–>之间的html和js代码;放在<body></body>之间。

原文地址

» 本文来自:前端开发者 » 《前端3D立体功能按钮CSS3按钮》
» 本文链接地址:https://www.rokub.com/5801.html
» 您也可以订阅本站:https://www.rokub.com
赞(0)
64K

评论 抢沙发

评论前必须登录!