gpt4 book ai didi

html - IE HTML 中的条件语句是否被删除?

转载 作者:行者123 更新时间:2023-11-28 03:28:06 24 4
gpt4 key购买 nike

所以我看到了一些很奇怪的东西。我正在运行 Windows 8.1/IE11,不确定这是否重要。

我插入了以下 html 注释。一个是直接从 HTML5 样板文件中提取的,所以我确信这至少是正确的。

当我打开开发工具时,我可以在 IE11 和 IE10 的模拟器中看到 DOM 中的注释。只要我在模拟器中使用文档模式和用户字符串进入 IE9 或更低版本。您在下面看到的所有条件 IE HTML 注释和条件 IE 注释由于某种原因无法在任何地方看到。

有没有人见过这样的东西?知道为什么会发生吗?我已经穷尽搜索无济于事。

    <!DOCTYPE html>
<html>
<head>
<title>@ViewBag.PlatformModel.PlatformTitle </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="~/Scripts/html5shiv.js"></script>
<!--[if lt IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="~/content/platform/css/ie78.css"/><![endif]-->
<!--[if lt IE 9]>@Styles.Render("~/Content/platform/css/IE78.css")<![endif]-->

<!--// kendo common, kendo theme-->
@Styles.Render("~/Content/kendo-common-styles")
@Styles.Render("~/Content/kendo-theme-styles")

<!--// platform -->
@Styles.Render("~/Content/platform-styles")

<!--// page styles -->
@RenderSection("styles", required: false)

</head>
<body>
<!--[if lt IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

最佳答案

您可能想要更新 Windows 并安装最新的补丁。 RTM 的 IE11 中的 F12 工具附带一个错误*,其中模拟文档模式不遵守条件注释。这已经被修复了。

* http://connect.microsoft.com/IE/feedback/details/806767/conditional-comments-do-not-work-when-emulating-document-modes-via-f12-developer-tools

关于html - IE HTML 中的条件语句是否被删除?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19830405/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com