DOCTYPE [英] DOCTYPE

查看:64
本文介绍了DOCTYPE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我正在使用的PHP文件:


<!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">

< head>

< meta http-equiv =" Content-Type"含量=" text / html的;字符集= UTF-8英寸/>

1)是那个标准,它应该是唯一的方式吗?


2)用meta标签声明utf-8,是吗命令我的

MySQL表也使用utf-8? (我现在有拉丁语1。)

here''s what I''m using for my PHP files:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1) Is that standard, and the only way it should be?

2) with that meta tag declaring utf-8, is it imperative that my
MySQL tables also use utf-8? (I have them at latin 1 now.)

推荐答案

Jerry Stuckle写道:
Jerry Stuckle wrote:

>>
我也注意到Dream Weaver甚至不提供拉丁语1作为默认编码的
选项 - 所以也许它是DW很古怪
>>
I also just noticed that Dream Weaver doesn''t even offer Latin 1 as an
option for the default encoding - so maybe it is DW that is wacky.



进一步检查时,DW提供西欧字样。作为一个选项,

,如果我选择那么ISO-8859-1实际上是将

插入到(通常是无用的)元标记中。这样就可以为同一个字符集生成3

的同义词。


此外,在考虑了一下之后,输出发生的事实

动态,因为php不重要,对吧?如果我下载

我的php页面,保存源为* .html,然后将那个

文件发布为* .html,那么最终结果是一样的 - 至于

DOCTYPE去了。


所以这真的是一个HTML问题,无论是否产生的输出是b / b $ b作为php。

On further checking, DW offers "Western European" as an option,
and if I choose that then ISO-8859-1 is what actually gets
inserted into the (mostly useless) meta-tag. So that makes 3
synonyms for the same charset.

Also, after thinking a bit, the fact that the output originates
dynamically as php shouldn''t matter, right? If I were to download
my php page, save the source as *.html, and then publish that
file as *.html, then the end result is the same - as far as
DOCTYPE goes.

So this was really an HTML question, independent of whether that
the output originated as php.


仅仅因为验证器没有发现所有错误并不意味着你

这些都不是错误,而是有效的SGML 。它们只是

中的有效XML与众所周知的HTML部分形成对比。
Just because the validator doesn''t catch all errors doesn''t mean you
These are NOT errors but valid SGML. They are just not valid XML in
contrast to the part of HTML that is widely known.


仅当您使用模式验证器时。 W3验证器是基于SGML的,
Only if you use a schema validator. The W3 validator is SGML-based,

,它不适合验证X(HT)ML。
which is not appropriate for validating X(HT)ML.



否。但它适用于验证HTML。因为HTML是SGML。

这就是我所说的:HTML支持的内容远远超过你想要使用的内容。但是如果你想使用一个子集,请使用官方的,基于XML:XHTML。

No. But it is appropriate to validate HTML. Because HTML is SGML.
Thats what I said: HTML supports much more than you want to use. But if
you want to use a subset, use the official one, that is based on XML: XHTML.


这篇关于DOCTYPE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆