Forum Moderators: open

Message Too Old, No Replies

Alignment not working Firefox

         

jagannathch

2:53 pm on Aug 31, 2007 (gmt 0)

10+ Year Member



Hi,

I am trying to center align a submit button on my code. It is working fine in IE, but not in Firefox.

My code snippet is as follows:

<p align="center">
<h1 align="center"> Verification Page</h1>

<p align="center">Welcome! You will have to verify your identity through Trufina first, before accessing the website.</p>

<p align="center">Please click the submit button below to verify yourself</p>

<p align="center">

<form action="http://localhost/test/userjoin6.php" align="center">
<input align="center" name="submit" type="submit" id="submit" value="Submit" />
</form></p>

As is evident, I have tried all the tags for aligning it to the center, but still on firefox, it shows the button to the left. But it works perfectly on IE.

Any suggestions? Thanks in advance!

The_Hat

3:18 pm on Aug 31, 2007 (gmt 0)

10+ Year Member



There is probably a more elegant way of doing it but try replacing the opening <p> tag with <div align="center"> and the closing </p> with </div>

The_Hat

3:23 pm on Aug 31, 2007 (gmt 0)

10+ Year Member



Oh and by the way... as far as I have experienced it should be the other way around... for what the code said IE has it wrong and Firefox had it right.. it's just that firefox is more stringent on what the code says. IE is more forgiving..

tedster

5:51 pm on Aug 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A lot depends on your DTD (doctype declaration) because align="center" is deprecated in HTML 4 [webmasterworld.com]. Becaus of this, Firefox will ignore that attribute under many doctypes.

Try using CSS instead - style="text-align:center" for inline elements, and style="margin:0 auto" for block level elements