• 欢迎来到本站,本站主要做程序员相关技术、博客、笔记,如果喜欢本网站那么赶紧使用Ctrl+D 收藏吧!
  • 如果有任何疑问,可以在下方文章下方留下你的评论~

Comments in HTML and How to use conditional annotation in HTML?

生活日常 8个月前 (10-11) 3次浏览 0个评论

If your code block is commented out by HTML, it will not be displayed by the browser.You can write some auxiliary information in HTML comments.

Using HTML Comment Tags

<!-- Write a note here -->

You can also comment a sentence or a piece of code:

<!-- This is a comment -->

<p>This is a paragraph.</p>

<!-- Remember to add more information here -->

HTML condition comment

<!--[if IE 8]>
    .... some HTML here ....
<![endif]-->

Note: conditional comment define HTML tags that are executed only by Internet Explorer.

Three common forms of HTML conditional comment:

Is it IE?

<!--[if IE]> html code... <![endif]-->
<!--[if !IE]> html code... <![endif]-->

What version of IE is it?

<!--[if IE 6]> Your html... <![endif]-->
<!--[if IE 8]> Your html... <![endif]-->

What range is IE?

<!-- The internal HTML code will only be executed by browsers below IE8 -->
<!--[if lt IE 8]> Your html... <![endif]-->

<!-- IE7 and above browsers will execute the internal HTML code -->
<!--[if gt IE 7]> Your html... <![endif]-->

中国笔友, 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Comments in HTML and How to use conditional annotation in HTML?
喜欢 (0)
发表我的评论
取消评论
表情 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址