How to make a submit button display as a link?

后端 未结 8 822
春和景丽
春和景丽 2020-12-03 06:51

This is not working in IE:

.text-button { background: transparent; 
               text-decoration: none; 
               cursor: pointer; }





        
相关标签:
8条回答
  • 2020-12-03 07:39

    Try this:

    <style type="text/css">
        .text-button 
        { 
            background-color: Transparent;                 
            text-decoration: underline;                 
            color: blue;
            cursor: pointer; 
            border:0
        }    
    </style>
    <input type="submit" class="text-button" value="vote+"/>
    
    0 讨论(0)
  • 2020-12-03 07:39

    I believe the answer submitted above by mofolo is the more correct solution

    CSS styling of submit buttons to make them look like anchor tags does NOT cross browser. The text-decoration:underline style is ignored by many browser types.

    The best method in my experience is to use javascript on an anchor tag's onclick event.

    For example:

    A "Delete" link on a user details form screen, with confirmation before submitting the form with an id of "userdetails"

    <a href="#" onclick="if(confirm('Are you sure you want to delete this user?')){document.forms['userdetails'].submit();}return false;">Delete</a>
    
    0 讨论(0)
提交回复
热议问题