HTML的隐藏功能 [英] Hidden features of HTML

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

问题描述

HTML是使用最广泛的语言(至少作为标记语言)还没有得到应有的赞誉。

考虑到它已经存在了这么多年,像FORM / INPUT控件这样的东西仍然保持不变,因为没有新的控件添加。



因此,至少从现有的功能,你知道任何不知名的功能,但非常有用。



当然,这个问题是一致的:



隐藏的JavaScript特性 >
CSS的隐藏功能

C#的隐藏特性

VB.NET的隐藏特性
Java的隐藏功能



隐藏ASP.NET的功能

Python的隐藏功能

TextPad的隐藏功能

Eclipse的隐藏功能



请勿提及HTML 5.0的功能,因为它位于工作草案



请为每个答案指定一个功能

使用独立于协议的绝对路径:

 < img src =// domain.com/img/logo.png\"/> 

如果浏览器正在通过HTTPS在SSL中查看页面,那么它将使用https协议,否则它会通过HTTP请求它。



这可以防止在IE中出现可怕的本页包含安全和非安全项目错误消息,您的资产请求使用相同的协议。



警告:当用于样式表的< link>或@import时,IE7和IE8 下载文件两次。然而,所有其他用途都很好。


HTML being the most widely used language (at least as a markup language) has not gotten its due credit.
Considering that it has been around for so many years, things like the FORM / INPUT controls have still remained same with no new controls added.

So at least from the existing features, do you know any features that are not well known but very useful.

Of course, this question is along the lines of:

Hidden Features of JavaScript
Hidden Features of CSS
Hidden Features of C#
Hidden Features of VB.NET
Hidden Features of Java
Hidden Features of classic ASP
Hidden Features of ASP.NET
Hidden Features of Python
Hidden Features of TextPad
Hidden Features of Eclipse

Do not mention features of HTML 5.0, since it is in working draft

Please specify one feature per answer.

解决方案

Using a protocol-independent absolute path:

<img src="//domain.com/img/logo.png"/>

If the browser is viewing an page in SSL through HTTPS, then it'll request that asset with the https protocol, otherwise it'll request it with HTTP.

This prevents that awful "This Page Contains Both Secure and Non-Secure Items" error message in IE, keeping all your asset requests within the same protocol.

Caveat: When used on a <link> or @import for a stylesheet, IE7 and IE8 download the file twice. All other uses, however, are just fine.

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

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