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

后端 未结 22 1079
执笔经年
执笔经年 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:53

    This is what I used. Link button is

    
    

    CSS

    /* body is sans-serif */ 
    
    .link-button {
        margin-top:15px;
        max-width:90px;
        background-color:#eee;
        border-color:#888888;
        color:#333;
        display:inline-block;
        vertical-align:middle;
        text-align:center;
        text-decoration:none;
        align-items:flex-start;
        cursor:default;
        -webkit-appearence: push-button;
        border-style: solid;
        border-width: 1px;
        border-radius: 5px;
        font-size: 1em;
        font-family: inherit;
        border-color: #000;
        padding-left: 5px;
        padding-right: 5px;
        width: 100%;
        min-height: 30px;
    }
    
    .link-button a {
        margin-top:4px;
        display:inline-block;
        text-decoration:none;
        color:#333;
    }
    
    .link-button:hover {
        background-color:#888;
    }
    
    .link-button:active {
        background-color:#333;
    }
    
    .link-button:hover a, .link-button:active a {
        color:#fff;
    }
    

提交回复
热议问题