css和xhtml中的每个元素和属性、属性是否有必要使用小写?
4.2.元素和属性名称必须采用小写
XHTML 文档必须对所有 HTML 元素和属性名称使用小写。这种差异是必要的,因为 XML 区分大小写,例如
来源:http://www.w3。 org/TR/2002/REC-xhtml1-20020801/diffs.html#h-4.2
但是元素的属性、属性、值、类和 ID 也是必需的吗?
不应使用大写字母和小写字母。
每件事都使用小写有什么好处?
4.2. Element and attribute names must be in lower case
XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.
Source : http://www.w3.org/TR/2002/REC-xhtml1-20020801/diffs.html#h-4.2
But is it also necessary for attributes, properties, values, class and ID for elements.
Upper case and came case should not be used.
What is the benefit of use lowercase for every thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几个很好的理由:
There are a few good reasons:
唯一真正的好处是您的网页将符合 XHTML。浏览器建立在“在你发出的内容上保持保守,在你接受的内容上保持自由”的哲学之上,并且做疯狂的大写事情不应该抛出任何它们(也许IE除外,但那是一场完全不同的战斗)
至于理论上的好处,它为开发人员节省了时间/精力,但据我所知,浏览器不在乎,所以......
The only real benefit is that your webpage will be XHTML compliant. Browsers are built on the philosophy of "Be conservative in what you emit and liberal in what you accept", and doing crazy capitalization things should not throw any of them (except maybe IE, but that's a whole other battle)
As for theoretical benefits, it saves time/effort for developers, but AFAIK, browsers don't care, so...