zoukankan      html  css  js  c++  java
  • 我总结和探索出的注释技巧

    (从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期2014-03-06)

    在编码的工程中,如果遇到需要临时修改部分文件,但是事后有需要方便的取消更改,可以采用以下的方法来进行。

    /*我的修改——————————————start

    修改后的内容

    /*我的修改——————————————end*/

    /*原来的文件——————————————start*/

    原来的内容

    /*原来的文件——————————————end*/

    通过更改两块代码的上方的注释结尾符号的位置来快速切换有效的代码块。如下:

    /*我的修改——————————————start*/

    修改后的内容

    /*我的修改——————————————end*/

    /*原来的文件——————————————start

    原来的内容

    /*原来的文件——————————————end*/

    ps:上面中间的横线最好使用中文的横线,防止编译器警告。

    //备注的内容 

    上面的备注方式,不能使用在css中,虽然编译器会显示被注释成功的样式,但是浏览器解析时,会不解析此注释下一行的样式代码。

    /*commented by *** on 140621 被注释的内容 */

    采用以上做法,同一天的修改都采用以上做法,方便你进行日后管理。在搜索框输入commented by *** on 140621就能看到同一天修改的内容(一处修改往往涉及到好几处修改)

    <!--第一层的注释

    第一层的注释

    </!--第二层的注释--/>

    -->

    注释中的注释,采用以上方法破坏掉注释结构,同时最完美的保留注释痕迹。

    ==============================================================================

    示例:

    CSS注释:

    ————

    /*动态消息滚动样式——————————————————————————————start

    #latest-news-index{ float:left; height:45px; background:url("images/last-news-bg.gif") no-repeat; auto !important; margin:0px auto; }

    #latest-news-index_r{ float: right; height:45px; background:url("images/last-news-bg.gif") no-repeat; auto !important; margin:0px auto; }

    .bound{ 482px; overflow:hidden;margin-left: 20px;float: left}

    .latest-news{ 472px; height:35px; float:left; overflow:hidden; }

    .latest-news a{ color:#666;}

    .latest-news .title{80px;height:35px; margin:12px 5px 0px 0px; float:left;padding-left: 10px}

    .latest-news .title a{font-weight:bold; color:#BB0000;}

    .latest-news .newscontent{382px; height:35px; float: none; margin-left: 95px; margin-top: -103px;}

    .latest-news .newscontent div{ height:35px; line-height:35px;line-height:35px;*line-height:12px;_line-height:35px; overflow:hidden;}

    .latest-news .newscontent div a:hover{color: #F00}

    /*动态消息滚动样式——————————————————————————————end*/

     

    /*静态消息样式——————————————————————————————start*/

    #latest-news-index{ float:left; height:45px; background:url("images/last-news-bg.gif") no-repeat; auto !important; margin:0px auto; }

    #latest-news-index_r{ float: right; height:45px; background:url("images/last-news-bg.gif") no-repeat; auto !important; margin:0px auto; }

    .bound{ 482px; overflow:hidden;margin-left: 20px;float: left}

    .latest-news{ 472px; height:35px; float:left; overflow:hidden; }

    .latest-news a{ color:#666;}

    .latest-news .title{80px;height:35px; margin:12px 5px 0px 0px; float:left;}

    .latest-news .title a{font-weight:bold; color:#BB0000;}

    .latest-news .newscontent{382px; height:35px; float: none; margin-left: 85px;margin-top: 2px;}

    .latest-news .newscontent div{ height:35px; line-height:35px;line-height:35px;*line-height:12px;_line-height:35px; overflow:hidden;}

    .latest-news .newscontent div a:hover{color: #F00}

    /*静态消息样式——————————————————————————————end*/

    html注释:

    ————

    <!--动态滚动html代码——————————————————————————————start

    <div style="height:35px; overflow:hidden;"><a href="jxs.php" target="_blank">食品招商</a>、<a href="zhaoshang.php" target="_blank">媒体招商</a>、<a href="shop.php" target="_blank">促销品</a></div>

    <div style="height:35px; overflow:hidden;"><a href="shop.php?cid=717&classid=727&jid=0" target="_blank">即期尾货</a>、<a href="shangbiao.php?classid=235" target="_blank">商标转让</a>、<a href="job.php" target="_blank">人才招聘</a></div> 

    <!--动态滚动html代码——————————————————————————————end-->

    <!--静态横条html代码——————————————————————————————start-->

    <div style="height:35px; overflow:hidden;"><a href="jxs.php" target="_blank">食品招商</a>、<a href="zhaoshang.php" target="_blank">媒体招商</a>、<a href="shop.php" target="_blank">促销品</a>、<a href="shop.php?cid=717&classid=727&jid=0" target="_blank">即期尾货</a>、<a href="shangbiao.php?classid=235" target="_blank">商标转让</a>、<a href="job.php" target="_blank">人才招聘</a></div>

    <!--静态横条html代码——————————————————————————————end-->

  • 相关阅读:
    Struts2的OGNL的用法
    详解DataTable DataSet以及与数据库的关系
    ModBus 协议
    STM32串口接收中断溢出问题解决
    STM32 GD32 时钟设置
    STM32 中断
    STM32 中断系统
    STM32中断系统(NVIC和EXTI)
    STM32中断系统
    GD32E230 GPIO 时钟
  • 原文地址:https://www.cnblogs.com/ferron/p/4529768.html
Copyright © 2011-2022 走看看