Styling form buttons with CSS - no onclick behaviour?

Live forum:


18-09-2008 14:42:47

I'm working on styling a form with CSS. Is there a way to cause the button element to NOT move down and to the right (along with its text) when it is clicked?


18-09-2008 14:54:59

I'd have to dust off the CSS memory banks and get back to you, but offhand I'd say no, not if you're using an actually form submit button. I think most designers who want full control over their submit buttons don't actually use the submit button type, they use an image with an onclick handler to submit the form. That way you have total control over the style and behavior, so if you want no button "animation" you don't get it, and if you do then you can accomplish that with CSS up/down/hover actions.


18-09-2008 15:20:44

I'm actually using an HTML button with CSS styling rather than an input submit. The button calls javascript to submit the form.

lieditli - I've been able to achieve what I want using the method described on this page http//[]http//


18-09-2008 21:13:08

Dont forget that you have an image type submit button. May not be what you need, but it may help you one day.
<input type='image' name='submit' value='submit src='some/url/here' />


19-09-2008 10:11:48

I'm trying to avoid relying on creating a new image everytime I need to create a button with different text.