关于html里面的注释标记问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:22:58
Original
1041 people have browsed it

就是在html里面众所周知,可以用来进行注释!
但是在标签体中目前发现2种是不能这样注释的
1.


回复讨论(解决方案)

style中用 /*  */ 
script用
// 单行
/*  */ 多行

style中用 /*  */ 
script用
// 单行
/*  */ 多行 这个知道!但是能不能回答下我提出的2个问题呀?


是xml 文件使用的注释方法

html文件可以  因为html 是xml 的延伸

script 和 css 文件 并不是 xml 格式 他们有他们自己的规范

html文件引用的并不一定是 html



回答你的第二个问题。按照规范去写你的代码,这样你以后维护或者让别人看也能方便些。

我的建议是,写一段代码就写注释,这样有利于注释。

关于注释:

//js

/*css*/



jsp:

这个本身也不是注释的,你在html里面看到的这个只是为了让html兼容ie6以下版本的浏览器,比如:


有些样式在老版本的浏览器无法识别,加上这个以后就可以识别了。你去看看别人做的比较好的程序,模板里都是这么写的,兼容性好

至于javascript里面是如何,我也不知道,也没有必要去纠结这个。你就按规范来是没有错的,有些东西人家早就规定好了在那里,你只要记住它是这么用的就可以了,没有什么为什么


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!