|
| |
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
Question About DocTypes - 1/19/2007 21:41:08
Which DocType do I need to use? There is html 4.01 and xhtml strict, transitional, and frameset...plus xhtml 1.1. I'm going to guess that the frameset one is right if your site uses frames? I don't know. I found a site that has those files links, and a description, and I know that each browser needs to know what standards to render the page in - but how do I know which docType is right for me? Bruce
|
|
|
|
Kitka
Posts: 2515 Joined: 1/31/2002 From: Australia Status: offline
|
RE: Question About DocTypes - 1/19/2007 23:09:03
If you are unsure, it is usually safest and easiest to use html 4.01 Transitional. Best way to find out is to test a selection of your pages in a validator. Try strict first and see how many errors it finds, then change it to transitional and see how much difference there is. Pick the one that you are most comfortable adjusting your code for. http://validator.w3.org/
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Question About DocTypes - 1/20/2007 3:39:45
I'd disagree very slightly in that it's better to go for a strict DOCTYPE from the start rather than a transitional one (which are by their nature only meant to have been transitional in their usage). On your site on the other thread Bruce you're using a HTML 4.01 Strict DOCTYPE and I'd say that's probably the one to go for. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/20/2007 3:57:27
I'm going to add docType to all of my pages.
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/20/2007 15:34:30
Can someone explain the difference between html 4.01 and xhtml 1.1? And strict & transitional? What is it transitioning to? And another problem. I inserted a docType from the list into my page at the very top, line#1, and went to the W3C validator and it says the declaration is not valid or missing. And, the spacing of some elements went crazy when I added the docType. Here is the page. Bruce
< Message edited by Bruce2000 -- 1/20/2007 16:19:45 >
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Question About DocTypes - 1/20/2007 16:33:23
Avoid XHTML 1.1 it's a no no at the moment. I'm no expert but I think it goes like this. HTML 4.01 is the latest version of HTML as laid down by the W3C (following 2.0, 3.0 etc etc). XHTML 1.0 is a reworking of HTML using many of the conventions of XML - it's not HTML, it's not XML - imagine they had a really great night out and nine months later - bam! XHTML came along! HTML should be served by the web server as text/html (i.e. what's known as tag soup). It's basically a slower older way of the browser working out what's on the page. XHTML 1.0 is sort of meant to be a bridge between HTML and XML - although it has many of the conventions of XML it can still be served as text/html by the web server and the browsers that receive it that way will interpret it as if it's HTML (they'll read the tag soup). XHTML 1.0 can also be served as application/xhtml+xml to browsers that understand it which will help those browsers interpret it quicker and basically they'll treat it as xml which is useful if you want to do some complex techie math stuff (don't ask what). IE is incapable of reading any page served as application/xhtml+xml - it breaks it completely and you can the "would you like to download this page" box instead of a page. XHTML 1.1 CAN ONLY BE SERVED AS application/xhtml+xml according to the W3C and therefore IE cannot understand XHTML 1.1. You occasionally see 1.1 pages used and read by IE but that's only because they've been served incorrectly as text/html which is naughty. You'll see a lot of people (including me) using XHTML 1.0 and serving it as text/html - there's no real advantage in doing this because of the IE thing - you're only really pretending to use XHTML. Only reason I keep doing it is habit really. There's nothing wrong with it but there's no real advantage in it either. Transitional markup is meant to be what it sounds - a bridge between the previous verison of the markup and the more correct version (strict). So basically you can get away with more using Transitional. Some people look at that as an advantage - I don't. In my view it's better to go for the most correct, strictest version of whichever standard of markup you choose - be it HTML 4.01 or XHTML 1.0 . So after that long ramble - try to stay with Strict and stay well away from XHTML 1.1 unless you fancy doing mime type switching according to browser - I've had a go at that myself and it's not worth the hassle.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Question About DocTypes - 1/20/2007 16:43:54
Phew! You were editing while I was writing there! The problem is that you have a mix of coding styles there. You're using a HTML 4.01 Transitional DOCTYPE but you've got closing slashes in your stylesheet link "/>". Self closing slashes like that are a XHTML thing. Take that out and you'll be left with the other errors which (I didn't look down all of them) such as forgotten alt text etc. Edit: not too sure I was clear about the problem there - because the validator ran into the self-closing tag it basically threw it's hands up into the air and called every other tag on the page an error. Remove the self closing tag from the stylesheet link and you'll be left with the actual errors on the page.
< Message edited by Tailslide -- 1/20/2007 16:56:46 >
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Question About DocTypes - 1/20/2007 16:58:09
Man you're waaaay too slow Jaybee. I've gotten 2 posts in and an edit already! I'm exhausted now - going to bed.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
rubyaim
Posts: 757 Joined: 6/22/2005 Status: offline
|
RE: Question About DocTypes - 1/20/2007 17:09:53
Hi Bruce, this article includes elements and attributes that are not allowed when using a strict doctype and might be useful: Transitional vs. Strict Markup This might be interesting as well It's Time To Kill Off Transitional DOCTYPES
< Message edited by rubyaim -- 1/20/2007 17:15:55 >
_____________________________
Sally
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/20/2007 20:39:48
Now that I'm adding the doctype, I get a lot of wierd validation errors. Like "there is no attribute "background" when I have in a <td> tag this: background="images/indexhdr.jpg" and it shows up in the browser just fine but the validator doesn't think it is there. if I change that tag at all, the background image doesn't show up. Also, I have a counter on my site which I get from SiteMeter. They have the code on their site to copy and paste which I did, and it has been working, but the validator doesn't like it because of the <noscript> tags that surrond the actual number, it says that it is missing a start tag.. What could the problem be? Edit: I fixed the background error. apparently it does not consider a background image valid unless it is in CSS, so I put it in my stylesheet and got it off the html page. Now when I go to validate I still get one error about the noscript.
< Message edited by Bruce2000 -- 1/21/2007 0:34:17 >
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/21/2007 12:07:17
www.bruceleibowitz.net is my main page and it doesn't validate except for that one error. I began to tackle another of my pages fix-up work, starting with inserting the docType declaration on line 1 of the code. Big Problem. No matter which doctype I select, they're all messing up my page and in some ways that i can't fix! For example, vertical spacing is off on some elements, character spacing is not the same when viewed in FP and when previewed in browser, fonts look different (some are bold that aren't supposed to be), in fact the windows standard WingDing font doesn't show up when viewed in Firefox but it does in IE and inside frontpage. The online version of my page, without doctype, shows all fonts perfectly fine and the spacing is exactly how I made it and in both browsers. It is almost like I need to start from scratch and re-do every single html tag on the page. Do I understand this correctly, that a doctype declaration is only useful to validate html? A page without this document would still render in all browsers? I have opened my own allegedly error-filled site in both IE and Firefox and it looks identical, exactly how I created it, and I've opened it on computers other than my own and it still looks the same - Now that I think about it, I am wondering if its even worth the work. Its all very confusing. A page looks different even between frontpage and browsers (opening the page locally in a browser window) so in effect What You See Is Not What You Get. bruce
|
|
|
|
womble
Posts: 5603 Joined: 3/14/2005 From: Living on the edge Status: offline
|
RE: Question About DocTypes - 1/21/2007 12:25:34
That's the problem with WYSIWYG - most of the time you don't (and WYSIWYG editors do have a tendancy to alter code for you which can mess up things). Using a doctype and validating isn't an end in itself though, it's only a means to an end. Using a doctype tells the browser which flavour of (x)html you're using, so it doesn't have to guess. Not using a doctype throws browsers into quirks mode, and it's then that strange things can start happening because if you're not using "official" HTML tags etc. then it'll make it's best guess as to the correct way to render the page, which might not be what you were expecting. Having a page that's valid is the best way to ensure that it's going to display as intended across all the browsers. The problem with using doctypes is that you really do need to understand HTML, and what the validator errors mean. At the start you end up with loads of errors and things all over the page, but after a while using the offcial HTML specs becomes second nature and you find that often you'll be able to do a page and have it validate first time. Differences between browsers is often down to the different ways they interpret markup, such as how they interpret margins and padding and stuff. As for the wingding font - that's a M$ font, which is why you see it in IE and in FP. In general though if you want to be cross-browser friendly you need to use either only the commonly installed fonts that everyone has on their machines (there are various links to sites around here that list the "safe" fonts to use), or for small bits of text you need in a particular font, use an image - but that brings a whole heap of other problems as well.
_____________________________
~~ "A cruel god ain't no god at all" ~~
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/21/2007 13:49:33
I understand the concept of different browsers possibly interpreting code differently unless they are following a standard...but my site looks identical from Frontpage's own preview to IE to Firefox. I think that a good web authoring software should include a doctype when you create a new page - why wouldn't they want the page to be standards-compliant and cross-browser compatible? I have a friend who made a site using Coffee Cup Visual Studio, and it has a doctype (although he does have errors still) but everything lines up when I view it. I dont think he knows enough about web design to have put it in after the fact - I would think that program must have created a standard-compliant page from the start.
|
|
|
|
caz
Posts: 3547 Joined: 10/10/2001 From: Somewhere south of Chester, UK Status: offline
|
RE: Question About DocTypes - 1/21/2007 14:08:25
Bruce, don't give up or give in to the inevitable confusion that "validation" brings with it when you have used Frontpage and/or other WYSIWYG applications that hide the html code from you. As you rightly say your page looks OK in IE and Firefox and only has 2 errors in validation at the moment and these are related to the lack of table summaries "Make the table summary available to the user. Authors should provide a summary of a table's content and structure so that people using non-visual user agents may better understand it." This means that users of text-to-speech browsers need to be told what the table represents - there are other kinds of browsers as well as the visual ones that you and I use and these rely on being served valid code in order to work as they should for their users. You can get a great deal of help with web design and standards from 2 browser add ons, the Web Developer Toolbar which is a Firefox extension and the Accessibility toolbar for Internet Explorer . If you download these for each browser you can use the Validation option to check your code and get help with the errors. Both incorporate something called HTML Tidy which will do just that based on the Doc type that you use. They are both well worth using and you will learn a lot on the way.
_____________________________
Do not meddle in the affairs of cats, for they are subtle and will dance, or more on your keyboard. Cheshire cat. www.doracat.co.uk I remember when it took less than 4hrs to fly across the Atlantic.
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Question About DocTypes - 1/21/2007 14:12:08
Some WYSIWYG editors might be able to create a standards compliant page without you going in and fiddling with the code - but it'd be quite unusual. Most don't. Certainly FP doesn't (without your intervention). You can set FP up to include a DOCTYPE with every new page but there's no guarantee that FP will produce anything near standard compliant code. It's a M$ product and they're only really worried about the pages showing correctly on M$ products such as IE. If it was possible to use a WYSIWYG editor to produce standard compliant, semantic, accessible code every time there'd be no-one like me hand-coding we'd all be using WYSIWYG editors.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Bruce2000
Posts: 149 From: Huntsville AL USA Status: offline
|
RE: Question About DocTypes - 1/21/2007 14:25:52
Take one issue for example. I have some font in a table that is showing up as bold when it should not be (using a doctype page). I went in and changed the table, row, cell - every instance of font-style formatting i could find to make it "normal" but it was to render as bold. I don't know what else to di.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|