alamodey
alamodey

Reputation: 14938

Changing the look of form buttons

With this little bit of CSS, my form buttons now look flattened (2D) and I quite like the look:

input {
  border: 1px solid #999;
}

However, for file fields (select file to upload), the button is still 3D. And then the border goes all around that button and the text next to it.

I tried fixing this problem by renaming input to .input, and then only applying it to my Submit/Cancel buttons, but now they look like how the file field looks. So how do I fix this so they all look flattened/2D?

Also, is there a way to create these form buttons as normal links? I quite like how they look. I'm programming in Rails so it would be nice if you could post the helper function for that if it's available.

Upvotes: 4

Views: 805

Answers (2)

Ballsacian1
Ballsacian1

Reputation: 17324

http://extjs.com/forum/showthread.php?t=29032
This thread uses the ExtJS library to create an input button that can be styled. I wouldn't necessarily use ExtJS for this one reason alone, but if you really want to get fancy look at the code for his file button. Instead of positioning the file button on top of your image and tweaking it till it works nicely, this piece of Javascript actually centers the button wherever your mouse is. Allowing you to create extremely fancy looking buttons of all shapes and sizes.

Upvotes: 0

mr-euro
mr-euro

Reputation: 2752

To create the submit button as a normal text link you could attach an onclick events with Javascript instead to a single word instead of using the submit button.

Upvotes: -2

Related Questions