Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 11-19-2009, 03:28 PM
Junior Member
 
Join Date: 09-04-09
Location: FL
Posts: 4
iTrader: 0 / 0%
How Can I center This Form, Anyone.

I am trying to put a form inside of a pop hover. Here is the screenshot below with the white opt in form inside but it's on the right, I want it to be in the middle.



Here is the Code


<table border="0" cellpadding="3" cellspacing="0"><tr><td><font face="Verdana" size="2"><p align="center"><strong>Sign up now To be Notified When We Have Sales and Giveaway Events </font></p><p align="center"><style>
.link,
.signupframe {
color: #030000;
font-family: Arial, Helvetica, sans-serif;
}
.link {
text-decoration: none;
}
.signupframe {
border: 1px solid #FFFFFF;
background: #F4EFEF;
}
</style>
<form method=post action="https://app.icontact.com/icp/signup.php" name="icpsignup" id="icpsignup2162" accept-charset="UTF-8" onsubmit="return verifyRequired2162();" >
<input type=hidden name=redirect value="http://www.icontact.com/www/signup/thanks.html" />
<input type=hidden name=errorredirect value="http://www.icontact.com/www/signup/error.html" />

<div id="SignUp" style="text-align: center;">
<table width="260" class="signupframe" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign=top align=center>
<font size="1" face="Arial,Helvetica, sans-serif">*</font> <font size="2">Email</font>
</td>
<td align=left>
<input type=text name="fields_email">
</td>
</tr>
<input type=hidden name="listid" value="15786">
<input type=hidden name="specialid:15786" value="2KF6">

<input type=hidden name=clientid value="569119">
<input type=hidden name=formid value="2162">
<input type=hidden name=reallistid value="1">
<input type=hidden name=doubleopt value="0">
<TR>
<TD> </TD>
<TD><font size="1">*</font><font size="2"> = Required Field</FONT></TD>
</TR>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">

var icpForm2162 = document.getElementById('icpsignup2162');

if (document.location.protocol === "https:")

icpForm2162.action = "https://app.icontact.com/icp/signup.php";
function verifyRequired2162() {
if (icpForm2162["fields_email"].value == "") {
icpForm2162["fields_email"].focus();
alert("The Email field is required.");
return false;
}


return true;
}
</script></div>
<p align="center"><a class="link" href="http://www.icontact.com"><font size="2">Email Marketing You Can Trust</font></a>
</p></td></tr></table>

Please, Help me fix that
 
Reply With Quote
  #2 (permalink)  
Old 11-19-2009, 04:24 PM
Izzmo's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 11-01-03
Location: Kansas
Posts: 1,356
iTrader: 1 / 100%
I'm surprised it's not centered, but you can put a style attribute in the table opening tag as such:

Code:
<table width="260" class="signupframe" style="margin: 0px auto;" border="0" cellspacing="0" cellpadding="5"> <tr> <td valign=top align=center> ... rest of script ...
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
 
Reply With Quote
  #3 (permalink)  
Old 12-02-2009, 02:28 AM
Junior Member
 
Join Date: 11-02-09
Posts: 4
iTrader: 0 / 0%
If the style attibute didn't help might as well add a div there
 
Reply With Quote
  #4 (permalink)  
Old 12-02-2009, 09:22 AM
FGTH's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 03-06-04
Posts: 612
iTrader: 0 / 0%
Add this to your CSS declarations:

Code:
#SignUp {position:absolute; top: auto; left: 50%; margin-left: -130px;}
 
Reply With Quote
  #5 (permalink)  
Old 12-02-2009, 09:26 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-17-09
Posts: 50
iTrader: 0 / 0%
I've been having similar problems and the above solution works a treat - thanks!
 
Reply With Quote
  #6 (permalink)  
Old 12-03-2009, 12:16 PM
PowerSEO's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 10-02-09
Location: US
Posts: 58
iTrader: 0 / 0%
Use Text-Align:Center property. I tested and its working with your form
 
Reply With Quote
  #7 (permalink)  
Old 12-07-2009, 01:25 AM
Member
Latest Blog:
None

 
Join Date: 12-07-09
Posts: 42
iTrader: 0 / 0%
Centering can differ between browsers.

So setting text-align : center; is a wise move on all containers where centering is required (that can include the body and then perhaps text-align: left; the paragraphs).

The other method is the margin and that is the preferred W3C method, margin : 10px auto 10px auto;

the auto should balance the margin in the containing element, and it should end up looking centred, but some browsers don't support auto, and text-align: center; should also be set.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Center web with FRAMESET? skyscraper Web Design Lobby 5 04-25-2008 03:58 AM
your life center of it.. potchie Forum Lobby 17 12-23-2007 10:56 AM
How do you center a web page? factoring Coding Forum 10 06-16-2007 06:29 AM
Data center 64.233.161.99 POR-15 Depot Google Forum 31 02-16-2004 06:14 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 09:41 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.