I know that I can assign an onclick action to <input type="button"
-style buttons. But is it possible to let it behave like an <a>
without using JavaScript? I ask because I'm in a situation where technically I'm better off using <a>
's, but buttons look nicer.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
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.
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.You could just use CSS to make your links look like buttons.
For example: How to make sexy buttons with CSS
While styling with CSS as Justin suggests is probably the better approach, the literal answer to your question is: