Web Development

General discussion


HTML: Alter margins of submit button?

By johnm ·
Why do submit buttons have a 20 pixel or so margin on each side of the text? I mean is it really necessary to have all that open space-- I am not looking for a place to graze cattle on.

I am putting in an add to shopping cart button, and I could fit it into the space I need to, if I just got rid of those pesky margins. Is there a way?

I know I could use an image instead, but let's face it, making a cool button with css and text is a way better way for me to waste time.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

use images

by Brent_D In reply to HTML: Alter margins of su ...

just use images and the onclick event

Collapse -

No images

by johnm In reply to use images

Images take time to load. I want my customers to buy, not watch paint dry on the wall.

Collapse -


by johnm In reply to HTML: Alter margins of su ...

Ok, if anyone wants to get rid of those margins, I finally found a solution:

.button {
padding: 0 5px;
width: 100% 100%;

Ok, the syntax of the width attribute looks funny, but hey, it works on IE and netscape (dont know about moz, op, fb, etc...)

Now my "Add to Shopping Cart" button is not as long as the New York marathon.

Guinness as usual

Related Discussions

Related Forums