views:

515

answers:

4

I have applied the following CSS to a FORM submit button:

font:normal 15px helvetica,arial,sans-serif;
padding:6px;

On Windows, regardless of the browser (IE/Firefox/Chrome), this increase the FORM submit button and give the button spacing padding of 6px.

However, on OS X (Mac), the form submit button is not stylized at all. Meaning, the font size is the default and no padding is being applied.

Any idea on how I can make a FORM submit button bigger on OS X (Mac)?

A: 

Make an image button. Safari will not style buttons, or checkboxes, or drop down menus, etc.

Scott Saunders
Safari 4 under Windows allows it. Are they offering different functionality under OS X?
Jason
A: 

Styling form controls is very problematic. See this example - while other browsers apply some styles, all the buttons look nearly identical in Safari.

One solution is to use a <div> with the onclick JavaScript attribute. This way you can apply standard CSS normally. I'd recommend starting with a button then using JS to switch in the better-looking code as progressive enhancement.

DisgruntledGoat
+1  A: 

In Safari 4, padding and sizes won't take effect on submit buttons unless you set a background or border. Example:

background: #ccc; /* without this, the other styles won't show up */    
font: normal 15px helvetica,arial,sans-serif;
padding: 6px;
Justin Kramer
If I add a background color, that doesn't make it look then like a native button
Teddi
Correct. Safari does not allow you to make a native button larger than the default -- only smaller. See http://webkit.org/blog/28/buttons/ for more details.
Justin Kramer
@Justin, any work arounds?
Teddi
Nope. If you want it to look native with big text, your only option is aping the native look with CSS -- e.g., a background image. Apple is protective of their look-and-feel.
Justin Kramer
+1  A: 

Instead of using <input type="submit" /> use <button type="submit">Submit Text</button>, if I remember correctly, this has much better support for css stylings.

Jordan S. Jones