+ -
当前位置:首页 → 问答吧 → 请教<!-- -->的作用,附代码

请教<!-- -->的作用,附代码

时间:2010-08-18

来源:互联网

看见一段代码,不知道<!-- -->的作用,没有行吗?
<style type="text/css">
<!--
* { margin:0; padding:0 }
div, dl, dt, dd { display:inline-block; }
div, dl, dt, dd { display:block }
h2{ font: 800 12px/20px "宋体"; }
#tabs { border:1px solid #ccc; margin:40px; width:382px; padding:4px 0 }
#tabs div { padding:69px 4px 0px; position:relative; }
#tabs dt { text-align:center; font: 12px/60px "宋体"; }
#tabs dd { font: 12px/20px "宋体"; padding:10px; }
#tab1 dt { left: 4px; top: 4px }
#tab2 dt { left:130px; top:4px }
#tab3 dt { left:256px; top:4px }
#tab4 dt { left: 4px; top: 4px }
#tab5 dt { left:130px; top:4px }
#tab6 dt { left:256px; top:4px }
.close dt { height:60px; width:120px; background:#FAFAFA; position:absolute; border:1px solid #ccc }
.close dd { display:none }
.open dt { height:65px; width:120px; background:#EBEBEB; position:absolute; border:1px solid #ccc; border-bottom:none; }
.open dd { background:#EBEBEB; border:1px solid #ccc; }
-->
</style>

作者: tiyoto   发布时间: 2010-08-18

<!-- -->  是html里面的注释符号,   等同于 //  

他包含的东西是用来提醒的,不参与编译````

作者: zhoulong2008cs   发布时间: 2010-08-18

不过<!-- --> 里面的内容的确起了作用,试着去掉<!-- --> ,效果一样

作者: tiyoto   发布时间: 2010-08-18

这个 是容错用到的。有的不支持<style 的浏览器。可以吧  CSS代码样式隐藏起来。不显示!

作者: ldwz   发布时间: 2010-08-18

楼上正解

作者: boss   发布时间: 2010-08-18

相关阅读 更多

热门下载

更多