CSS链接按钮示例

来源:互联网 发布:北京软件销售招聘 编辑:程序博客网 时间:2024/05/12 20:17

#elButton1 a /*关闭button(使<a><button>的效果)*/

{

     background: transparent url('../../Content/Images/button_bg.jpg') no-repeat scroll top right;

     text-decoration: none;

     height:auto;

     width:80px;

     padding-left:100px;

     padding-bottom:20px;

     cursor:default;

}

 

#elButton1 a:hover /*发布新闻button(使<a><button>的效果)*/

{

     background: transparent url('../../Content/Images/button_bg_over.jpg') no-repeat scroll top right;

}

这样,在页面中可以减少JS代码,只下面一行代码就OK:

<%= Html.ActionLink(" ", "Index", new { id = Model.sid })%>

这个链接既有按钮的样式,又有<a></a>的特性,可以实现.net MVC中的action跳转!

原创粉丝点击