IE 不使用怪异模式需要的最低 doctype 是什么?
我正在为 SharePoint 2007 进行开发,但我漂亮的代码正在被破坏,可能是由 SharePoint 围绕我的内容编辑器 Web 部件生成的代码所破坏。我的理解是,由于在 SharePoint 将代码发送到浏览器之前没有进行“顶级”文档类型声明,因此 Internet Explorer 被迫以怪异模式呈现页面。因此,整个页面的渲染不考虑某些 CSS 声明,并且我的页面看起来是错误的。
我希望说服当局相信这个问题值得解决,但我想我需要能够告诉他们我想要什么......
那么,当我用 XHTML 编写时,什么文档类型最有效(严格)使用 CSS2 但我的代码周围的东西不严格?
I am developing for SharePoint 2007 and my pretty code is being broken, presumably by code SharePoint generates around my Content Editor web-part. My understanding is, because there is no "top level" doctype declaration made before SharePoint sends the code to the browser, Internet Explorer is forced to render the page in quirks mode. Thus, the entire page is rendered without respecting certain CSS declarations and my page looks wrong.
I have hopes of convincing the powers that be that this issue is worth fixing, but I figure I need to be able to tell them what I want...
So, what doctype would work best when I'm writing in XHTML (strict) with CSS2 but the stuff surrounding my code is not strict?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会将您的文档声明为 HTML5,并且 HTML5 明确定义了浏览器应如何处理损坏的代码,以便您的结果在所有浏览器上看起来应该都是一样的。
This declares your document as HTML5, and HTML5 clearly defines how browsers should handle broken code so your result should look the same on all browsers.