You are here: Re: Need some clarifications on xhtml « HTML « IT news, forums, messages
Re: Need some clarifications on xhtml

Posted by cwdjrxyz on 10/11/95 11:59

Thierry Lam wrote:
> I've decided to switch to xhtml and I've added the following at the top
> of my page:
>
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
> However, my page is still working and I can't see any warnings whenever
> I use old html tags like <br> instead of <br/>. What other things
> should I add to validate xhtml tags?

Go to http://validator.w3.org/ to validate a page as any of several
forms of html/xhtml including the one you mention. The break tag you
mention usually is written with a space included in it as <br />. I
believe this was done to avoid problems with some browsers. In general
all tags have to be closed in xhtml. When tags such as br and img that
have no close tag in html are used they most be closed as was done for
br above such as <img blah />. Closing p is optional in html. In xhtml
a paragraph must always use a closing tag </p> in addition to the
opening tag <p>. Unless you set up your server to serve true xhtml
using an extension such as xhtml and associating a mime type with it
such as xhtml+xml, the page will just be served as text/html despite
your xhtml tags and Doctype. Note the page will still validate as xhtml
if there are no errors. The validator just checks the code for what you
ask. However if you use the advanced interface to validate, there will
be additional information showing you how the page is served. Recent
Firefox, Netscape, Opera, and a few other browsers can handle xhtml
served correctly as such. However IE6 will not, and you can not view
the page. You have to provide IE6 and a few older browsers with an html
4.01 strict page using some server side code or whatever to allow
viewing of the page by them. Unless you do all of this, there is no
point in writing the page in xhtml if IE6 and some older browsers are
intended to be viewed with it. Unfortunately it appears that not even
IE7 will handle true xhtml. It is quite possible to serve even xhtml
1.1 correctly. However, to do so, you have your work cut out for you
and much to learn, likely including some server side languages.

When a page is properly served as xhtml is viewed with a browser that
can handle it, the browser becomes as strict as a mother superior in a
1800s convent. Tiny code errors that would cause little or no harm on
an html page often cause the browser to give you an error message
rather than a view of the page. Unless one writes very good html 4.01
strict, don't even think of writing xhtml and serving it properly as
such.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация