Aligning <form> in Firefox (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


craigj1303 -> Aligning <form> in Firefox (5/24/2007 18:18:28)

Hi

http://uk.geocities.com/johnson463@btinternet.com/HTML/WC150STD2LGOPT.html

In the above link there is a picture with a form underneath. In IE the form is aligned center but in Firefox the form is aligned left. I cannot understand this because the form is inside a container DIV which has the text-aligned center which is how I want it. I have even tried putting <p> tag around the form to experiment but it doesn't seem to affect the look of the form in Firefox.

Any ideas?




caz -> RE: Aligning <form> in Firefox (5/24/2007 21:05:19)

Try this in your css,

form {margin-left: 35%;}


Then you will have to experiment with positioning the Paypal image. Your page doesn't validate btw and Firefox is picky about valid code whereas IE will make a guess.




craigj1303 -> RE: Aligning <form> in Firefox (5/25/2007 4:47:51)

I tried the margin-left 35% idea but of course then the form looks center aligned in FF but out of sync in IE!

With regard to the validation, I knew that there would be certain things that failed validation which I fully intended to sort out (alt="" for images etc.) but there is so much that has failed validation that I don't know how to begin trying to resolve i.e. the problems with the "&" signs in the <form> code. That code is generated by Paypal so I can use their services!




Tailslide -> RE: Aligning <form> in Firefox (5/25/2007 5:02:08)

What you need to do is add the following rule to your stylesheet:

form {margin:0 auto;text-align:center;width:200px;}

I've given it a width of 200px but obviously you can change that.

There's a line of code before the DOCTYPE ( <!-- saved from url=(0022)http://internet.e-mail -->) which if you can you should remove (it might be some rubbish put in by Geocities) as it will throw browsers into Quirks mode which makes rendering more unpredictable - there should be nothing at all before a DOCTYPE.




craigj1303 -> RE: Aligning <form> in Firefox (5/25/2007 10:56:13)

Thanks Tailslide, that CSS worked great!! Yes, that comment before the Doctype must have been added by Geocities at some point. I have deleted it but we'll have to see whether it comes back when I upload the file again. I only use Geocities because it gives me a bit of free webspace to try stuff out on. When this site is finished I fully intend to purchase some decent hosting.

All I need to do now is resolve umpteen errors that fail validation! Should I post questions on this in another post do you think?




Tailslide -> RE: Aligning <form> in Firefox (5/25/2007 11:01:22)

Probably best - it'll help others when they're searching for answers to problems.

You may well find that clearing up one or two issues will wipe a whole load of errors off the list so don't be too despairing!




craigj1303 -> RE: Aligning <form> in Firefox (5/25/2007 11:02:14)

By the way, I just deleted that ( <!-- saved from url=(0022)http://internet.e-mail -->) rubbish and now when i'm testing the site in IE (offline) the thumbnail links don't work that open the larger picture. What would that be do you think?




craigj1303 -> RE: Aligning <form> in Firefox (5/25/2007 11:10:02)

Not to worry, I just deleted that comment from all my HTML pages and seems to work Offline now (despite IE occasionally bringing up some rubbish about allowing active stuff!)




Tailslide -> RE: Aligning <form> in Firefox (5/25/2007 11:13:19)

Sigh - oh god I hate IE!!

Off-hand I don't know without testing. With that line before the DOCTYPE browsers would have been working in Quirks Mode (which translates roughly as "who knows anything could happen mode").

Having a quick look at the markup there's no obvious reason - assuming that I'm looking in the right place! It's the link from the thumbnails to the larger version with the Paypal button that's the problem?

Edit: seen you're follow up now - good!




coreybryant -> RE: Aligning <form> in Firefox (5/25/2007 13:14:49)

Flash and Windows XP Service Pack 2 might help to explain the
<!-- saved from url=(0013)about:internet -->
information




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875