/    Sign up×
Community /Pin to ProfileBookmark

How do I align submit button using CSS?

Can anybody tell me the proper way to center align a submit button?

I am trying to limit the use of tables on my web site. I have got a submit button that is not inside a table. The We Schools web site says that the use of [B]align=”center” [/B] using the <p> tag is deprecated and to use styles instead.

[url]http://www.w3schools.com/tags/tag_p.asp[/url]

The style sheet has a command “align-text: center” that can be assigned to a style for use with a <p> tag. But the command indicates to align [I]text[/I]. A submit button is not text.

I would appreciate any information.

Thanks.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@timdentyJun 01.2007 — Well, you could perhaps approach it another way. If your layout is fixed width, you could apply a left margin to your submit button to create the desired effect. You wouldn't really put a submit button within a <p> tag.
Copy linkTweet thisAlerts:
@ray326Jun 01.2007 — text-align applies to all inline elements, not just text. Shoot, IE even incorrectly applies it to block elements but l digress. Since inputs are inline it will work although Tim is correct in stating it probably is incorrect putting an input into a paragraph. Use a div instead.
Copy linkTweet thisAlerts:
@KnoxVolauthorJun 01.2007 — timdenty; ray326;

Thanks for responding. I appreciate the help.
×

Success!

Help @KnoxVol spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...