电脑怎么识别html,如何让IE识别HTML 5标签?(How can I make IE recognize HTML 5 tags?)

如何让IE识别HTML 5标签?(How can I make IE recognize HTML 5 tags?)

什么是使我的HTML 5页面与IE兼容的好方法(至少IE 7和8)?

我可以使用哪种行业标准使IE识别和 ?

What are some good solutions for making my HTML 5 pages compatible with IE (at least IE 7 & 8)?

Is there an industry standard that I can use that will make IE recognize things like and ?

原文:https://stackoverflow.com/questions/3621435

更新时间:2019-12-18 23:18

最满意答案

是的,如果你愿意,你可以运行html5shiv ,这就是你所指的。 它将允许IE最初解析标签。 但是如果你想使用innerHTML (或基于它的框架代码),那仍然会给你带来同样的问题。 有innershiv ,但它不是非常有效,它不适用于所有顶级元素。

你想通过使用像这样的无语义但没有行为的元素来实现什么? 您将承担额外的浏览器问题,实际上没什么好处。 说实话,我今天真的不会打扰。 这是未来的事情。

Yeah, you can run the html5shiv if you want, which is what you seem to be referring to. It'll allow IE to parse the tags initially. But that will still leave you with the same problems if you want to use innerHTML (or framework code based on it). There's the innershiv, but it's not wonderfully efficient and it won't work for all top-level elements.

What do you want to achieve by using the semantic-but-behaviour-free elements like ? You will be taking on extra browser problems for little practical benefit. To be honest, I really wouldn't bother, today. It's something for the future.

相关问答

如果//td/div[../a[@name]]适合您,那么以下内容也应该有效: //td[a/@name]/div

这样你就不需要来回 - 或者向下和向上 - 。 对于更具体的选择器,您可能需要尝试以下操作: //td/div[preceding-sibling::*[1][self::a/@name]][following-sibling::*[1][self::a/@name]]

XPath选择具有以下所有属性的div元素: td/div :是

元素的子元素 [preceding-s

...

块级元素( h4所属的)不允许在内联元素中,并且将导致未定义的行为。 您可以使用span元素。 Block level elements (to which h4 belongs) are not allowed inside inline elements, and will cause undefined behaviour. You can use span elements instead.

在HTML5中,是的。 你只需要用data-前缀。 见规格 当然,这意味着你应该使用HTML5 doctype( ),即使浏览器不在乎。 In HTML5, yes. You just have to prefix them with data-. See the spec. Of course, this implies you should be using the HTML5 doctype (), even though bro

...

在Visual Studio中,您可以在.JS文件的顶部定义jquery.min.js的引用路径。 您也可以将jquery源文件拖放到单独的.JS文件中,Visual Studio将自动为您生成引用路径。 ///

//rest of your code starts

In Visual Studio, you can define reference path of your jquery.min.js o

...

它们肯定用于为标记添加语义。 例如:

Example Blog Post

Blog text goes here...

不像使用HTML5标签那样可读:

...

是的,如果你愿意,你可以运行html5shiv ,这就是你所指的。 它将允许IE最初解析标签。 但是如果你想使用innerHTML (或基于它的框架代码),那仍然会给你带来同样的问题。 有innershiv ,但它不是非常有效,它不适用于所有顶级元素。 你想通过使用像这样的无语义但没有行为的元素来实现什么? 您将承担额外的浏览器问题,实际上没什么好处。 说实话,我今天真的不会打扰。 这是未来的事情。 Yeah, you can run the html5shiv if you w

...

嗯,这是一个完全的noob问题。 答案很简单。 要解决此问题,请使用应用程序底部状态栏上的选择器将文件类型从“HTML5”切换为“Django”。 Well, that was a total noob question. The answer is simple. To solve, switch the file type from "HTML5" to "Django" using the selector on the status bar at the bottom of the app

...

与简单地在ERB(或Haml或Slim)中编写html标记相比,使用Rails标记助手将会产生相当大的开销。 当使用“动态html”(在服务器端输入创建的标记意义上)时,这通常是可接受的可读性和生产率的权衡,但如果没有插值则完全没有必要。 基本上只是使用常识--Rails标记帮助程序(及其所有衍生工具,如表单帮助程序)并不是在视图中编写HTML的完全替代,而是作为实用程序,使变量更容易和更清晰地绑定到属性和标签的内容。 它们还使编写自己的帮助器方法变得更加容易,您可以以编程方式创建HTML而不是使

...

Vim可能没有检测到PHP文件中有HTML。 您是否尝试过手动设置文件类型? :set ft=html.php Vim may not be detecting that there is HTML inside of your PHP file. Have you tried manually setting the filetype? :set ft=html.php

是的浏览器会在幕后自动添加HTML标签: 看: 我的HTML文件: 在我的浏览器中(Chrome中的F12获取此OR CTRL + U以获取源代码): Yes the browser automatically add HTML tags behind the scenes: look: My HTML file: In my browser (F12 in chrome to get this OR CTRL+U to get the source code):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值