别忘记 CSS Naked DayApril 5, 2008

http://naked.dustindiaz.com/img/naked-day-08.png

今年的 CSS Naked Day 似乎很多人都忘记了。而去年的这个“节日”甚至 淘宝网 都参加了。下面是其官方的一些介绍

The idea behind this event is to promote Web Standards. 
Plain and simple. This includes proper use of (x)html, 
semantic markup, a good hierarchy structure, and of 
course, a good 'ol play on words. It's time to show off
your <body>.

创办这个“活动”并不是为了好玩,而是提倡 Web 开发人员使用具有良好结构的 HTML 。当然,完全抛弃 CSS 呈现页面的默认样式,是需要“勇气”的。

本人认为,如果条件允许的话,建议有兴趣的都可以参加。例如本人的 Blog “脱掉” CSS 样式以后,会是这个样子(看起来非常丑)。

http://files.gracecode.com/2009_11_05/638435599e43.jpg

作为对比,再贴张“正常”的

http://files.gracecode.com/2009_11_05/099235571cb4.jpg

如果不想浪费时间写相应的代码,可以使用官方提供的 PHP 函数(当然,也可以使用 Javascript 实现)。

<?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;
}
?>

已有 2 条评论

  1. cnzh cnzh

    最近流行"脱"嘛,很黄很暴力!!呵呵!

  2. 另外一个网站WordPress很久没有升级了,主要是嫌网站太慢,ssh上去操作麻烦,加上主人也很少更新。不过当Wordpress Automatic upgrade出现之后这一切都简单多了我只要在页面上点点鼠标就能升级了...

Yahoo 统计