Jump to content

[SOLVED] Can I make an a href look like a submit?


marmite

Recommended Posts

So, everyone is trying to do the opposite (to get their submits to look like regular links), and this is all I find on Google.

 

I'm sure this is really easy.

 

I have an <a href which doesn't need to POST any information... but as I have another submit on the page it looks silly to have this as a link or an image. I'd like it to look like a button.

 

It falls over when I simply try to add a form in with no inputs except the submit. Thanks ???

Link to comment
Share on other sites

Well, you're not going to get the link to look exactly like the submit buttons unless you style both of them a tad. The default button look is nigh impossible to duplicate on non-button elements, but with a little tweaking, we can get close.

 

Let's say you've got an <a> tag with a class of "pseudo_button" on it. Here is the CSS I would recommend you start with in order to begin your quest:

a.pseudo_button {
  text-decoration: none;
  background-color: #F4FAFA;
  padding: 2px 10px;
  border: 1px solid #2D5082;
  cursor: arrow;
  color: #000000;
  font-size: 11px;
}

 

This may be a good start, and then you can do whatever you need to modify it from there.

 

Good luck!

Link to comment
Share on other sites

Thanks!

 

(I am surprised: I thought it would be really easy to insert a submit button as an <a href... rather than trying to format my image/link to look like that)

 

You've saved me lots of time. Cheers!

Link to comment
Share on other sites

(I am surprised: I thought it would be really easy to insert a submit button as an <a href... rather than trying to format my image/link to look like that)

 

You could always use some javascript to tell a button to act like a link instead:

<input type="submit" value="myLink" onclick="window.location('newpage.html'); return false;" />

 

The only consideration is that a redirect like this requires javascript, and some people don't like requiring users to have it enabled. This would definitely be easier and a little more accurate, though, since you are using a submit button for the redirect.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.