What is the most practical dtd, works well and is forgiving?

4 replies
  • WEB DESIGN
  • |
I like to use xhtml strict as much as possible but there are a lot of times when it won't validate, if you have an embedded google video for example.

I was a bit surprised while looking for answers about this to find this thread.
XHTML 1.0 Strict, Transitional .. or XHTML 1.1?
1 or 2 posters there said that xhtml is dead, and the argument went back and forth a bit. Is it actually better to just use an html declaration?

Just to be clear, this is my first choice, not because I know anything about it, but I just read a lot of times that a strict xhtml declaration was best.
<!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">

When that mucks up, this one will validate on the same page. (at least so far)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Do you think that one of the posters to the thread above might have a point and it would be better to go with
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Or something like that? But when I do put that one in, the <head> that works with the first 2 doesn't validate with this one.


And a couple more questions about validating while I'm at it. I read lately that google doesn't use /html and /body tags because browsers just don't bother with them and it saves on bandwidth(!) I ran one of their pages through the validator and it had way over a hundred errors.

Have also seen a lot of comments that a lot of webmasters don't bother with validating at all. Any related experience with that?


And another question that I'm still thinking about from a different thread.
Originally Posted by mywebwork View Post

Personally I've never been concerned with the character set
I thought that would be fine as long as the page didn't have a foreign character. I'll try to paste in one of my tiny jokes that has a french accent over the final e, "toast flambé." I tried to validate a page that was saved as ANSI and had that on the page, and to my surprise it did validate, even though "charset=utf-8" was declared in the head.

The w3.org validator page makes it sound a bit important to use utf-8, but is this also just a complete non issue? It doesn't matter a bit?

thanks in advance, lloyd
#dtd #forgiving #practical #works
  • Profile picture of the author Richard Whyte
    Hi Lloyd

    I design many sites for clients and never use "strict"... When I have tried it, it has cause a nightmare of problems with the wide range of browsers out on the market.... Why bother?

    I alwas stay with transitional and if the browsers catch up in a while (but any designer knows you will always have some people on the back end of the curve) maybe I will tighten things up.... But I don't see that happening anytime soon....

    As for the tags, I come from a programing background. I always open and close all tags. Just looks sloppy to me not to follow good coding practices.

    Sure, some browsers will work fine without all the tags closed and some will even work without HTML or BODY tags, but again, I want my sites to be seen by as wide of a market as possible.... Why would I take the chance that they have an older browser and the page doesn't get interpreted correctly in it?

    Have a Great Day!
    {{ DiscussionBoard.errors[932942].message }}
    • Profile picture of the author Lloyd Buchinski
      Boy, once I got into the questions I wound up with a list longer than most IM bonus lists. I should have used bullet points. So I thought I'd come back and post the single most important question I'm trying to get at. What is the code for a good dtd and head combination?


      Originally Posted by Richard Whyte View Post

      Why bother?
      That hits a deep resonant cord, thanks.

      Originally Posted by Richard Whyte View Post

      Have a Great Day!
      (As I thump my desk) And that one is worth working on. You got a pretty early start on yours didn't you? Or are you in the time zone where Wimbledon is starting up right now? There seems to be a trace of an English accent around here.

      best wishes, lloyd
      Signature

      Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

      The KimW WSO

      {{ DiscussionBoard.errors[933342].message }}
  • Profile picture of the author Lloyd Buchinski
    So things are getting even more mess-terious. I've been looking at the source code of a few sites and found some that don't even have a dtd which I thought was essential. The third link in Richard Whyte's sig above (pardon the bandwith Richard) and Kurt's Tuelz site at Tuelz internet marketing and web site design software He offers some pretty highly rated software that is free to use on a single site. I was going to use the scrubz news feed so had that page handy in my bookmarks. Unfortunately couldn't get the .mod installation video instructions to play.

    Another interesting one from my bookmarks with no dtd, is Maharaji (Official site of Prem Rawat) The little squares bouncing around the begin button start to follow your cursor around once you are inside. It's a really neat effect that I have never seen anywhere else.

    So these certainly aren't amateur attempts at sites, why don't they have a dtd?
    Signature

    Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

    The KimW WSO

    {{ DiscussionBoard.errors[934071].message }}
  • Profile picture of the author cdwise
    I use xhtml 1.0 transitional thought I write my code to xhtml 1.0 strict. The reason I use the transitional doctype instead of the strict doctype is that it is more forgiving and the site may have ads on them that I do not have control over and will fail is a strict doctype is used.

    My reason for using xhtml 1.0 is that it forces well formed code so that you don't get complacent and sloppy. By using a valid doctype you are forcing web browser to use what is termed "almost standards mode". The "almost" is in there because no browser, no matter what they claim is 100% complaint with web standards. They can't be because what we refer to as a "standard" is really nothing more than a published recommendation and it does not explicitly state how every element is to be rendered. Which is both good and bad.

    If you do not use a valid doctype you are at the mercy of how the browser maker choses to implement quirks mode. That can get downright nasty if you try to keep the basic rendering of websites the same in the major browsers: FF, IE 6-8 (be glad when 6 gets to be a small enough percentage that we don't have to be concerned about it), Opera and Safari.

    I won't use XHTML 1.2 because of its modular nature and the need to more or less create your own dtd stating which modules you are using.

    Once there is reasonable browser support for HTML 5 I may switch to that but right now it is cutting edge and I'm not sure enough browser support is there - yet.

    As for no doctype on the Maharaji site - it is a Flash based site that I doubt complies with accessiblity reqirements in the US, UK, EU and most other countries. It appears that India is in the process of setting up their accessiblity policies (or so a quick Google tells me but this forum won't let me post a link to the article on cis-india.org). Many web designer/developers are ignorant of the accessiblity requirements. Also, some old school professional web designer/developers have not updated their skills and still code like they did when Netscape 4 was the major browser. Others have migrated from print and try to treat the web as if were print - ignoring as much as possible the differences between the mediums. These designers tend to use slice and dice with either tables or absolute positiong, something that can break pretty easily in modern browser.

    ____________________________________________
    Adobe Community Expert - Dreamweaver
    Microsoft MVP - Expression Web
    {{ DiscussionBoard.errors[934163].message }}

Trending Topics