CSS裸体日
CSS Naked Day

原始链接: https://css-naked-day.org/

CSS 裸奔日,每年4月9日举行,是一个提高网络标准意识的活动。参与者会在这一天移除他们网站的所有 CSS 样式,从而展现底层的 HTML 结构和语义化标记。这项活动突出了结构良好的 HTML 的重要性及其在创建可访问和功能性网站(独立于视觉样式)中的作用。 这项活动始于2006年,鼓励开发者确保他们的网站内容在没有 CSS 的情况下仍然可读且可导航。参与者可以链接到 CSS 裸奔日网站,或在活动页面上列出他们的“裸奔”网站。移除 CSS 的时间持续 50 小时,以涵盖所有时区的4月9日。这项倡议旨在推广 CSS 的最初目的:将内容与表现形式分离,防止 HTML 成为纯粹的表现性语言。

Hacker News 讨论了“CSS 裸体日”,这一天网站会去除所有 CSS 样式,以展现其底层结构。用户 rpgbr 提交了“CSS 裸体日”的网站。Hyperlisk 分享了用于移除页面样式和样式表的 Javascript 代码。另一位用户 saagarjha 幽默地指出,参与的网站也应该“裸体”,指的是一个提交的页面目前还没有去除样式。theandrewbailey 链接到他的博客,展示了它在没有 CSS 情况下的样子,而 desdenova 则质疑如果一个网站本来就打算让人在没有 CSS 的情况下查看,为什么还要添加 CSS。页面上还刊登了 AI 初创公司学校的广告。

原文

April 9 is CSS Naked Day!

Join us for the yearly festivities on April 9 of going nude on the Web!

The idea behind CSS Naked Day is to promote web standards. Plain and simple. This includes proper use of HTML, semantic markup, a good hierarchy structure, and of course, a good old play on words. In the words of 2006, it’s time to show off your <body> for what it really is.

CSS Naked Day editions

How to participate

On April 9, simply remove all CSS from your website, stripping it entirely of its design.

You can link to this page to let your visitors know about the nudity of your website! This option is for those who feel a need to give their visitors a reference as to what’s going on. This is not about getting traffic or making money. There are no ads on this site, nor will there ever be. This is about you, the people; getting naked.

You can instead add your website(s) here by creating an issue or updating the proper file! Note: Alphabetical order should prevent merge conflicts.

Don’t think, just strip

Here is a sample PHP function for developers:

<?php
function is_naked_day($d) {
  $start = date('U', mktime(-14, 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;
}
?>

Use it like this:

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

Wait… isn’t that 50 hours?

That’s correct. CSS Naked Day lasts for one international day. Technically speaking, it will be April 9 somewhere in the world for 50 hours, from 00:00, April 9 UTC+14:00 to 00:00, April 10 UTC-12:00 (10:00, April 8 UTC+00:00 to 12:00, April 10 UTC+00:00). This is to ensure that everyone’s website will be publicly nude for the entire world to see at any given time during April 9.

Tools and plugins

Attention plugin developers: If you have a CSS Naked Day plugin for a popular CMS, or written in a programming language not listed here, feel free to make a pull request and add it, or to post an email on the dedicated Google group if you’re not familiar with Git.

Origins

CSS Naked Day started in 2006 by Dustin Diaz, who organized it until 2009. From 2010 until 2014, it was hosted by Taylor Satula. The content in this page is extracted from the content of the respective pages. Since 2015, the project is maintained by Fabien Basmaison and Jens Oliver Meiert. (Jens once worked on a proposal for a CSS Naked Day Wikipedia page that retells the story.)

Famous words

This is a fun idea, fully in line with the reasons for creating CSS in the first place. While most designers are attracted by the extra presentational capabilities, saving HTML from becoming a presentational language was probably a more important motivation for most people who participated in the beginning.

Håkon Wium Lie

联系我们 contact @ memedata.com