Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

How to center a submit form?

7:44 am on Mar 19, 2013 (gmt 0)


Just setting up a "Coming Soon" splash page with SquareSpace, and running in to a slight issue. I know it's due to my complete lack of knowledge in CSS, so hopefully you guys can help.

I'm trying to have the submit button, submit field, and the text right above it, to all be horizontally aligned. Basically to have it be dead center of the page and lining up with the logo above it.

Currently each object seems to be off just a bit.

Not sure if this helps, but here's the current CSS I've added:

form input[type=submit] {
background : url("http://i3.photobucket.com/albums/y96/LoganCl/Submit-Button-1.png") no-repeat center center !important;
display: block;
margin-left: auto;
margin-right: auto;
width : 100px;
height : 50px;
border : none;
color : transparent;
text-indent: -9999px;
background-size: 100%;
7:38 pm on Mar 19, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi there logancl,

and a warm welcome to these forums. ;)

I would've been far better to have resized the image from 500x250 to 100x50 in the first place.

Nevertheless try it like this....

form input[type=submit] {
background-position:center center;

10:18 pm on Mar 19, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Show me a
text-indent: -9999px;

which is to say

and I'll show you a workaround for something that should probably have been coded differently in the first place.

Featured Threads

Hot Threads This Week

Hot Threads This Month