?
Solved

How can I get this submit button centered?

Posted on 2013-12-23
4
Medium Priority
?
232 Views
Last Modified: 2013-12-24
Check out my site at http://www.muscularchristianityonline.com/campus. I want to get the "submit" button at the top of the page centered relative to the fields to the left.

I've got my HTML below. You can find the stylesheet at http://www.muscularchristianityonline.com/stylesheet.css.

<table class="login">
		<tr>
		<td style="width:410px; height:23px; vertical-align:center;">
		<form action="student_validate_header.php" method="Post" style="display:inline; padding:0;"><input type="text" size="23" class="login" name="email" value="email">
		<input type="password" size="23" class="login" name="password" value="password">
		<input type="image" src="images/login.png" border="0" name="submit"></form></td>
		<td>
		<IMG SRC="images/spacer.gif" width="325" height="23">
		</td>
		<td background="images/spacer.gif" width="175" height="23" style="vertical-align:top;">
			<table style="padding:0px; border-spacing:0; border-collapse:collapse; background-color:#ffffff;"><form action="search.php" method="Post" style="display:inline; margin:0;">
			<tr>
			<td>
			<input type="text" name="search" size="23" value="" style='border:0px; height:18px'>
			</td>
			<td style="vertical-align:top;">
			<input type="image" src="images/search_icon.png" border="0" name="submit">
			</td>
			</tr>
			</table></form>
		</td>
		</tr>
		</table>

Open in new window

0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 8

Accepted Solution

by:
Adrian Crabtree earned 1200 total points
ID: 39737096
If you add "vertical-align: middle;", that should fix your issue. 

CSS

input[name="submit"] { 
  vertical-align: middle;
}

Open in new window

0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 600 total points
ID: 39737138
In addition, the button is wrapped below the email input when viewing in chrome. When in the console, I added 10px to the td and it worked although not centered vertically.  You should either make the inputs a little smaller or the td a little wider.
0
 
LVL 35

Assisted Solution

by:Dan Craciun
Dan Craciun earned 200 total points
ID: 39737430
For me, Chrome displayed it in line with the login fields, but Firefox displayed it below.

Anyway, vertical-align: middle seems to align it on the bottom of the fields (see picture). You need a margin-bottom of 2-3px to make it look like it's center vertically.

Submit button in ChromeSubmit button in Firefox
0
 

Author Comment

by:brucegust
ID: 39738183
Thanks guys!

I got it done, thanks to your expertise and counsel.

I've got another question at http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28325170.html and would welcome your suggestions.

Thanks and Merry Christmas!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question