ash's profile又知易行难了PhotosBlogLists Tools Help

    CSS 裸奔节

    第三届CSS裸奔节来了,今年(CSS Naked Day ‘08)的时间定在4月9日。

    活动目的

    CSS裸奔节的目的是推动Web标准。简洁为美。使用正确的(x)html,语义标记,良好的层次结构。暂时把页面设计抛弃,直接展示<body>吧。

    如何参与

    这里填表报名,报名后一个小时内,你的网站会在官方列表中出现。

    到了4月9日,将你网站上的CSS移除,抛掉页面设计。

    你也可以在那天把以下HTML内容放置于网站顶部:

    <h3>What happened to the design?</h3>
    <p>To know more about why styles are disabled on this website visit the
    <a href="http://naked.dustindiaz.com" title="Web Standards Naked Day Host Website">
    Annual CSS Naked Day</a> website for more information.</p>
    

    注:加上这些标注仅仅是为了向你网站的访问者说明情况,并不是为了带来流量或赚钱。CSS裸奔官方网站上没有任何广告,以后也不会放置广告。

    活动日期

    很多人非常关心CSS裸奔节的活动时间。今年定于4月9日,理由如下:

    • 活动日期应该定于周二、周三或周四,这几天网站流量比较高
    • 时间应该在4月份的第一周前后
    • 不应该是4月1日(要不谁信呢,呵呵)
    • 在活动通告发出至活动日期,至少有五天时间

    如何裸奔

    下面这个PHP函数可以用来裸奔:

    <?php
    function is_naked_day($d) {
      $start = date('U', mktime(-12, 0, 0, 04, $d, date('Y')));
      $end = date('U', mktime(36, 0, 0, 04, $d, date('Y')));
      $z = date('Z') * -1;
      $now = time() + $z; 
      if ( $now >= $start && $now <= $end ) {
        return true;
      }
      return false;
    }
    ?>
    

    可以这样使用该函数:

    <head>
    ...
    <?php
    if ( is_naked_day(9) ) {
      echo '<!-- naked day has no styles -->';
    } else {
      echo '<link rel="stylesheet" type="text/css" href="styles.css" />';
    }
    ?>
    ...
    </head>
    

    工具、插件

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    ash has turned off comments on this page.

    Trackbacks

    The trackback URL for this entry is:
    http://ashchan.spaces.live.com/blog/cns!8611A45461AE7EA6!1823.trak
    Weblogs that reference this entry
    • None