Making input buttons act like 's without JavaScript

后端 未结 4 1318
遇见更好的自我
遇见更好的自我 2021-01-25 13:38

I know that I can assign an onclick action to -style buttons. But is it possible to let it behave like an w

相关标签:
4条回答
  • 2021-01-25 14:15

    Some CSS libraries such as Twitter Bootstrap make this very easy.

    There is an example (named "One class, multiple tags" quoted below) where you can apply a .btn class to <a>, <button> and <input> tags.

    <a class="btn" href="somelink">Link</a>
    <button class="btn" type="submit">Button</button>
    <input class="btn" type="button" value="Input">
    <input class="btn" type="submit" value="Submit">
    
    0 讨论(0)
  • 2021-01-25 14:16

    While styling with CSS as Justin suggests is probably the better approach, the literal answer to your question is:

    <form action="where-you-want-to-go.html">
        <input type="submit" value="Hello">
    </form>
    
    0 讨论(0)
  • 2021-01-25 14:30

    You could just use CSS to make your links look like buttons.

    For example: How to make sexy buttons with CSS

    0 讨论(0)
  • 2021-01-25 14:39

    I think you could use css to design your links as buttons. You could use bootstrap , pure or other frontend frameworks you are familiar with because they are more easy to use and you just have to tag their class to an html object to inherit its css designs.

    0 讨论(0)
提交回复
热议问题