My website www.pheel.co.uk/expect_test seems to display fine in IE7 but with firefox it has a few inconsistencies, such as not centering and making the header cell too big! How can I fix this? Another problem is it's loading time, if anyone has any ideas to fix this, i'm all ears.
The problem, as always, is IE. You don't have a doctype. Without one, IE goes into quirks mode and doesn't attempt to perform like modern browsers do, such as Firefox. (IE is NOT a modern browser). In addition, you used IE as your initial test browser, so now you marked the page up according to the worst browser on the planet. So, add this as the first line of your markup to pull IE into the modern world: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Then let's see where we stand. Unfortunately, this may change things around in IE because we're changing the rules; but it must be done to keep all browsers on the right page.
In the CSS body, replace margin-left:0; margin-right:0; with text-align:center; and replace text-align:center; with margin: 0 auto; width: 881px; in the "#all" div EDIT: a doctype is recommended but is not affecting any of the visual elements of your page.
A doctype is REQUIRED for modern pages and it most definitely is affecting ALL visual elements on the page! You will NEVER get IE in line without one!
well that's an erroneous statement if i've ever heard one. this doesn't have anything to do with our little discussion over here: http://forums.digitalpoint.com/showthread.php?t=1209544 now does it?
No. A doctype is not required in any html page. However, not doing so throws browsers into quirks-mode and will thus cause the browser to not conform to the standards, however little they are considered, especially by IE. Being in quirks mode will render your html differently and in order to have 'cross browser consistency you should include a doctype. ~eric
Yeh, I tried putting a doctype in there, but all the xhtml and html doctypes just made the page act differently... so i removed it again.
Okay the page is centered now thanks to cscott5288 (thanks a lot buddy!) But there is still two problems; The content title section is larger in Firefox tha IE and the enquiry form isn't centered in FireFox but it is in IE If anyone can help I'd be grateful! Thanks, Michael
Seriously man. Add a doctype. To everyone but you, removing the doctype makes everything look different . Add a 4.01 html strict doctype. Then validate your html and css. Then post here again and I will help you out. It is much easier to make cross browser consistencies with validated code. Trust me. ~eric
Thanks eric, but validating it in css and html will take so long, I'd rather just get a quick fix and move on.
You just try and create a web page that works across all the browsers without one and then come back and tell me it's erroneous. Oh, wait! He did that and it's not working across browsers...and it doesn't have a doctype! And what's the advice given? Add a doctype! By its very definition, no doctype means you are in quirks and living in 1998 and HTML 3.2 or earlier.
what exactly is your definition of a modern website "drhowarddrfine"? If it involves w3 validated HTML/XHTML then your sadly mistaken. So, you've showed me one major site that uses valid mark up (msn). Now let me show a few sites that use invalid mark-up, and believe me this is just a few: www.google.com www.microsoft.com www.yahoo.com www.youtube.com www.nationalgeographic.com www.ebay.com/
Sorry about the arguments. But you are saying they are , and i quote, "REQUIRED". And I see plenty of sites that use this old <html><head> tradition. You can make ie "in line" without a doctype. The less code there is, the less there is to break. Quirks mode only makes it so the browser won't conform to the standards set by adding a doctype. If you add a doctype then you are basically signing a document saying you will not break the rules/standards of this doctype. If you do then thats why the validator throws errors at you. @csscott LOL @mcfc4eva I know it seems long and tedious but validating your html and css won't take that long. If you coded right then you won't have any/ very few. If you are that lazy then you have the option of letting the html validator only validate your code. Unfortunately the CSS validator makes you do the work. Trust me on this. It will be time well spent if you add a doctype and validate your html and css. It doesn't always have to be perfect though. Just validate your big errors like incorrectly nested elements, and typos (yes the validator throws them out at you). Validation is the first step in the solving process ~eric
You can not. Without a doctype, IE goes into quirks mode and uses the broken box model, misplacing margins and padding along with other misrepresentations I don't recall. That was from the late 1990s, folks. Read the docs. A proper doctype is required for conformance. You guys do read the W3C docs regularly, don't you?
Eric, my site now only has 1 small error, (the header cell). Please don't patronise me explaining the reasons for programming in valid html/css. I know the reasons for doing it, and I know how to do it - I started making that site without considering it's validity and I'm kind of regretting it now, but lets face it there is one small glitch and apart from that the site is complete. I am not going to go back and start again or validate it just to please you. Now that's clear, does anyone have a solution to the layout problem that doesn't include adding a doctype or validating it?
Unless your going to help out without blabbering on about the importance of doctypes, please don't comment any more in this thread. Thank you
fixed it without validating it or adding doctypes thank you cscott5288 for your contribution! thanks for the rest of your comments, shame that none of them made a difference or helped me.