CSS input submit

They have: 121 posts

Joined: Aug 2008

Does anyone know how to define the styling of an input tag in CSS only when the type="submit". I don't want to go through my coding adding class or id attributes.

serpico

He has: 698 posts

Joined: Jul 2005

As far as I know, you can do something like

input[type="submit"] {
...
}

Last I heard, though, it's not supported by all browsers, so you may be better off defining a "submit" CLASS...

Kurtis

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

Correct, that will not work in IE, if you care.

A good example of a submit button class at Dynamic Drive.

You could use some javacript to search through form elements for a submit type and add the style with dhtml...

They have: 121 posts

Joined: Aug 2008

Thanks for the info... darn IE... I'll just use find and replace and do it the old fashioned way

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I use this method to style form buttons on my websites, and it does work across different browsers.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.