专注于WEB前端开发, 追求更好的用户体验, 更好的开发体验 [长沙前端QQ群:234746733]

2007年5月

  • 给学院做的院徽夭折

    / 分类: 实践,生活 / No Comments

    大学念的不多,但是换了三个学院,旅管学院-商学院-经济学院。到经济学院后,看到公告说要搞院徽设计大赛,但看到一等奖奖金少的可怜,就没想做,后来经过劝说还是做了。做差不多的时候,放假回家了,回来再问,居然没信儿了。R。。就这样夭折了。不过还是要谢谢考拉MM和susan同学的帮助。留图仅做纪念,既然夭折,图片的含义及构思什么的就懒得讲了。。

  • CSS HACK 整理

    / 分类: 开发 / No Comments

    HACK1:[php]
    #example {
    margin:5px!important; /* for Firefox */
    margin:10px; /* for IE6 */
    margin /**/:11px; /* for IE5 */
    }
    *+html #example{margin:15px!important; }/* for IE7 */[/php]
    说明:!important声明可以提升指定样式规则的应用优先权。上面“for Firefox” 有“!important”,“for IE7” 也要加“!important”,否则实际出来后IE7依然使用第一个maring值5px。
    HACK2:[php]
    #example {margin:5px; }/* for Firefox */
    * html #example {margin:10px;} /* for IE6 */
    *+html #abc{margin:15px!important;} /* for IE7 */[/php]
    说明:“for IE7”要加“!important”,“+html”能被ie7与ie5.01所识别,但ie5.01不识别important,所以*+html 再加!important 才只能被ie7识别。
    HACK3:[php]
    #example {
    margin:5px; /* For Firefox */
    *margin:10px; /* For IE7 & IE6*/
    _margin:15px; /* For IE6*/
    }[/php]
    说明:这样写CSS文件无法通过验证,但是代码可以写的比较少。
    HACK4:使用IE专用的条件注释[php]
    <!--其他浏览器 -->
    <link rel="stylesheet" type="text/css" href="css.css" />
    <!--[if IE 7]>
    <!-- 适合于IE7 -->
    <link rel="stylesheet" type="text/css" href="ie7.css" />
    <![endif]-->
    <!--[if lte IE 6]>
    <!-- 适合于IE6及以下 -->
    <link rel="stylesheet" type="text/css" href="ie.css" />
    <![endif]-->[/php]
    说明:条件注释的语法:
    [*]gt /Greater than/大于/<!--[if gt IE 5.5]>
    [*]gte /Greater than or equal to/大于等于/<!--[if gte IE 5.5]>
    [*]lt /Less than/小于/<!--[if lt IE 5.5]>
    [*]lte /Less than or equal to/小于等于/<!--[if lte IE 5.5]>
    [*]! /Note/不等于/<!--[if !IE 5.5]>        
    HACK5:[php]
    example{
    margin: 5px;/*FF*/
    >margin: 10px;/*IE5*/
    }
    example/*IE5.5 */{
    >/*IE only*/margin: 15px;/*IE6*/
    >/*IE only*/margin /*IE5.5*/: 20px;
    }[/php]
    说明:“margin”定义的顺序不能改变,即FF-IE5-IE6-IE5.5。对于IE的定义在属性前要加“>”,因为“example/**/{}”这个HACK在FF中可以识别。