这个问题只能用代码的形式来解答,如下:
http://www.jqueryba.com/jquery/css3buttom.html
.btn-wrap {
text-align: center
margin: 50px
}
.btn{
position: relative
display: inline-block
line-height: 25px
padding: 5px 15px
margin:10px
transition: all .3s ease-out
text-transform: uppercase
border-radius: 5px
border: 1px solid #1e639a
color: #fff
font-weight: bold
cursor: pointer
text-shadow:0 1px 2px rgba(0,0,0,.4);
box-shadow: inset 1px 0 0 #559ad5,inset -1px 0 0 #559ad5,inset 0 1px 0 #559ad5,inset 0 -1px 0 #559ad5,0 0 1px rgba(0,0,0,0.5);
background: #4086c2/* Old browsers */
background: -*-linear-gradient(to bottom, #4086c2 0%,#2989d8 100%,#3378b1 100%);
}
.btn:hover {
background: #3378b1/* Old browsers */
background: -*-linear-gradient(to bottom, #3378b1 0%,#2989d8 0%,#4086c2 100%);
}
.btn:active:after {
content: ""
display:block
width: 2px
height: 2px
position:absolute
border-radius:2px
top:50%
left: 50%
margin: -1px 0 0 -1px
z-index:2
background: rgba(255,255,255,1);
box-shadow:0 0 10px 5px rgba(255,255,255,0.5),
0 0 20px 10px rgba(255,255,255,0.5),
0 0 30px 15px rgba(255,255,255,0.4),
0 0 40px 20px rgba(255,255,255,0.3),
0 0 50px 25px rgba(255,255,255,0.3),
0 0 60px 30px rgba(255,255,255,0.3),
0 0 70px 35px rgba(255,255,255,0.3);
需要准备的材料分别有:电脑、浏览器、html编辑器。
1、首先,打开html编辑器,新建html文件,例如:index.html。
2、在index.html中的<style>标签中,输入css代码:button {background-color: #00a7d0}
button:hover {background-color: #ff7701}。
3、浏览器运行index.html页面,此时显示出了蓝色背景颜色的按钮。
4、将鼠标移入按钮,此时按钮的背景颜色变成了橙色。
一般当前高亮都是后台程序判断实现的,不是css做的,要用css做也行,只是麻烦点,要给每个栏目的<body>加上ID,这样做造成的麻烦是弄后台程序的时候不能把<body>这行直接写入页头包含文件之中:下面代码每个body都有自己的ID来识别当前是什么栏目,导航栏每个li也加了class:
------------首页html------------
<body
id="home">
<div
class="menu">
<ul>
<li
class="home"><a>首页</a></li>
<li
class="about"><a>介绍</a></li>
<li
class="news"><a>新闻</a></li>
<li
class="job"><a>招聘</a></li>
</ul>
</div>
</body>
------------介绍页html------------
<body
id="about">
...
</body>
------------新闻页html------------
<body
id="news">
...
</body>
===============
Css
code:
===============
/*导航按钮的默认样式*/
.menu
li
a{color:#000}
/*当前栏目高亮样式*/
#home
.menu
.home
a
,
#about
.menu
.about
a
,
#news
.menu
.news
a
,
#job
.menu
.job
a{color:red}