|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 9
|
|
| Author |
|
|
Advanced Member Texas, USA Joined: Dec 8, 2003 Post Count: 3021 Status: Offline |
When I create a new page with my html kit and insert the doctype line (the program does that automatically) this line (see topic) appear as the very first line of the code. What does that mean/do? ---------------------------------------- ... |
||
|
|
Advanced Member USA Joined: Nov 27, 2003 Post Count: 6285 Status: Offline |
That is the mandatory beginning for XML. Introduction to the Annotated XML Specification - section 2.8, "XML documents may, and should, begin with an XML declaration which specifies the version of XML being used" If you are using XHTML what you are in fact writing is not HTML but XML. XHTML is XML written as HTML. The browsers wil read it as HTML. So you can use that on a page as it is technically correct being a xml document, however unneccesary for a (X)Html document, it usualy does not make a big difference. For more information on UTF - The Absolute Minimum Every Software Developer...racter Sets (No Excuses!) & More Specific on UTF-8 - Quick guide to UTF-8 |
||
|
|
Advanced Member Joined: Sep 14, 2003 Post Count: 647 Status: Offline |
actually it can be a headache as I learned from a couple of sites that it made IE align left when it should have been centered, I spent a lot of time looking for a not closed tag or missing div when it was {<?xml version="1.0" encoding="UTF-8"?> } being throwen in the mix. Dave offered some solutions to a fix in the css but I knew it was not necessary so I would remove it from an Xhtml page. Read this thread here Thelma as it tells about the dilemna I had with the same issue. Pay attention to the culprit in my final response in post six This is what caused my issue{ <?xml version="1.0"?>}Which is what tidy tossed in the mix that caused things to run afoul http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=1194#5272 ---------------------------------------- Don't let the bigdawg bite!!! ---------------------------------------- [Edit 1 times, last edit by bigdawgcaps at Aug 29, 2004 1:27:43 PM] |
||
|
|
Advanced Member Texas, USA Joined: Dec 8, 2003 Post Count: 3021 Status: Offline |
Is this in addition or instead of <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />? I peeked and noticed that neither Kyle, Dave, nor Steve use the UTF-8 but the meta tag line. The article Kyle suggested states this: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> >>>But that meta tag really has to be the very first thing in the <head> section because as soon as the web browser sees this tag it's going to stop parsing the page and start over after reinterpreting the whole page using the encoding you specified<<< I'm thinking utf-8 and iso-8859-1 are two different birds - and for HTML I should probably use iso-8859-1 (since that's what everyone seems to be using). So, in general, is this a good way to start a page: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="---" /> <meta name="keywords" content="----" /> <meta name="copyright" content="Andrea Barnett a & b WebDesign" /> <meta name="author" content=" Andrea Barnett a & b WebDesign " /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="ROBOTS" content="index, follow" /> <link rel="shortcut icon" href="favicon.ico" /> <link rel="stylesheet" type="text/css" href="....css"media="all"> </head> <body> </body> </html> ---------------------------------------- ... |
||
|
|
Advanced Member Joined: Sep 14, 2003 Post Count: 647 Status: Offline |
What I am saying is one layout that i have used with variations should always be centered on the page but that {<?xml version="1.0"?>} caused the page to align left.with Internet Explorer. I will show you how. This page will be centered in IE but the second example will not with the xml in the first line of text http://cafe789.com/stwc/benito.htm http://cafe789.com/stwc/benito1.htm If you look at the second link in IE you will see the page align left and it is the first line of text that is why This <?xml version="1.0"?> I have had to edit this as it was IE that caused these troubles ---------------------------------------- Don't let the bigdawg bite!!! ---------------------------------------- [Edit 3 times, last edit by bigdawgcaps at Aug 29, 2004 1:44:29 PM] |
||
|
|
Advanced Member Joined: Sep 14, 2003 Post Count: 647 Status: Offline |
IT HAS BEEN IE THAT HAS HAD THE PROBLEM ALIGNING LEFT AND NOT MOZILLA, I APOLOGISE TO MOZILLA FIRSTMOST BECASE THIS WAS AN IE ISSUE ---------------------------------------- Don't let the bigdawg bite!!! ---------------------------------------- [Edit 2 times, last edit by bigdawgcaps at Aug 29, 2004 1:31:03 PM] |
||
|
|
Advanced Member USA Joined: Nov 27, 2003 Post Count: 6285 Status: Offline |
Yea I have had some bugs with it as well. As for the UTF-8, I just have not gotten around to really reading the artikle yet or changing them. Part of the problem is that XHTML is in fact a XML document layed out as HTML. Once you use <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> you are serving up XML as HTML which a friend calls HTML Soup. You are basically sending your page to the prowser as HTML and not XHTML/XML....hence no use in using XHTML as all the advantages are gone. So until browsers are made that really parse the XML correctly.... you can use HTML 4... I just keep XHTML to keep me fine tuned to the correct coding.... I have heard hints off and on that UTF-8 is better for XML. |
||
|
|
Advanced Member USA Joined: Jul 21, 2003 Post Count: 749 Status: Offline |
I'm going to throw my two cents in here (as I was mentioned earlier) :-) I never use the <?xml version="1.0" encoding="UTF-8"?> in my web sites as I am essentially making HTML pages, though using XHTML to code them in. Also, as it's been pointed out, if you are buidling a page in text/html (content-type meta tag) and put anything - including the XML prologue - before the DOCTYPE, then IE throws a wobbler and goes into quirks mode most of the time. I've yet to make an XML page styled with CSS (do any browsers fully support this?) and don't use the UTF-8 character encoding because the support for this is still patchy. I would advise stripping the XML prologue out of your code and using the ISO character encoding in your meta tags. It'll be easy to strip out and replace if you need to later on and you're still getting a cross-browser, valid page that'll work now and into the future anyway. Dave ---------------------------------------- Building quality, affordable web sites worldwide - DMWebsites.com |
||
|
|
Advanced Member Joined: Sep 14, 2003 Post Count: 647 Status: Offline |
I agree completely that it goes into a quirky mode as Dave points out. Mozilla AKA FF seems to handle it correctly but IE has some problems. Running Tidy will cause it to be added. My keyboards was also in quirks mode this past weekend as one of the dogs jumped on my lap which caused me to have my drawer as well as keyboard on desk for a couple of days but yesterday i went to Home Depot and bought some corner braces shaped in an L shape and it is now better than when new as it is secured with 12 screws and has a nice snug fit. ---------------------------------------- Don't let the bigdawg bite!!! |
||
|
|
|
|
|
Current timezone is GMT Sep 5, 2010 9:35:02 PM |