Shai UI
Shai UI

Reputation: 51918

Styling a Button: Use Anchor or Input?

When I search for a css button generator they always have code that styles an anchor.

<a href="#" class="button">The Button</a>

But I'm wondering why they don't ever try to style a generic button:

<input type="button" value="The Button" />

is it because it's harder to style an input of type button?

Upvotes: 2

Views: 1154

Answers (2)

Stephen Senkomago Musoke
Stephen Senkomago Musoke

Reputation: 3523

The styling will make buttons and anchors look the same. However the functional aspects are what make you decide to use a button or a link.

I would recommend using a link if you are going to follow a link, and a button if you want to submit a form or perform an action, say AJAX call.

Upvotes: 4

CaldwellYSR
CaldwellYSR

Reputation: 3196

Typically the input buttons are going to look like whatever the users computer defaults to for a button. Using anchor tags along with image sprites lets you have more control over what the "button" is going to look like.

Upvotes: 2

Related Questions