How do I make an html link look like a button?

后端 未结 22 1119
执笔经年
执笔经年 2020-11-22 14:03

I\'m using ASP.NET, some of my buttons just do redirects. I\'d rather they were ordinary links, but I don\'t want my users to notice much difference in the appearance. I c

22条回答
  •  无人共我
    2020-11-22 14:56

    Use this class. It will make your link look the same as a button when applied using the button class on an a tag.

    or

    HERE IS ANOTHER DEMO JSFIDDLE

    .button {
        display: inline-block;
        outline: none;
        cursor: pointer;
        border: solid 1px #da7c0c;
        background: #478dad;
        text-align: center;
        text-decoration: none;
        font: 14px/100% Arial, Helvetica, sans-serif;
        padding: .5em 2em .55em;
        text-shadow: 0 1px 1px rgba(0,0,0,.3);
        -webkit-border-radius: .5em; 
        -moz-border-radius: .5em;
        border-radius: .3em;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
        -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
        box-shadow: 0 1px 2px rgba(0,0,0,.2);
    }
    .button:hover {
        background: #f47c20;
        background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
        background: -moz-linear-gradient(top,  #f88e11,  #f06015);
        filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
    }
    .button:active {
        position: relative;
        top: 1px;
    }
    

提交回复
热议问题