<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<rss version="0.91">
    <channel>
        <title>睡蓮‧池水間 :: 文章</title>
        <description><![CDATA[文章XML]]></description>
        <link>http://waterlily-lsl.com/modules/article/view.article.php/89/c15</link>
        <lastBuildDate>Sat, 11 Feb 2012 00:20:07 +0200</lastBuildDate>
        <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
        <image>
            <url>http://waterlily-lsl.com/modules/article/images/logo.png</url>
            <title>睡蓮‧池水間 :: 文章</title>
            <link>http://waterlily-lsl.com/modules/article/</link>
            <width>92</width>
            <height>52</height>
            <description>文章XML</description>
        </image>
        <language>zh-TW</language>
        <managingEditor>waterlily at waterlily-lsl dot com</managingEditor>
        <webMaster>waterlily at waterlily-lsl dot com</webMaster>
        <category>文章</category>
        <item>
            <title>網頁柵格系統研究</title>
            <link>http://waterlily-lsl.com/modules/article/view.article.php/89/c15</link>
            <description><![CDATA[類別: 網頁藝術<br />分頁標題: 960的秘密<br />來源: (http://www.uiplanet.com/)研究網頁柵格系統前，來看一組數據：<br />
<table class="artContable3" style="width:300px">
<tr>
<th>網站</th><th>首頁頁面寬度 px</th>
</tr>
<tr>
<td><a href="http://yahoo.com/" rel="external">Yahoo!</a> </td><td>950</td>
</tr>
<tr>
<td><a href="http://taobao.com/" rel="external">淘寶</a></td><td>950</td>
</tr>
<tr>
<td><a href="http://myspace.com/" rel="external">MySpace</a></td><td>960</td>
</tr>
<tr>
<td><a href="http://sina.com.cn/" rel="external">新浪</a></td><td>950</td>
</tr>
<tr>
<td><a href="http://www.163.com/" rel="external">網易</a></td><td>960</td>
</tr>
<tr>
<td><a href="http://live.com/" rel="external">Live Search</a></td><td>958</td>
</tr>
<tr>
<td><a href="http://sohu.com/" rel="external">搜狐</a></td><td>950</td>
</tr>
<tr>
<td><a href="http://youku.com/" rel="external">優酷</a></td><td>960</td>
</tr>
<tr>
<td><a href="http://aol.com/" rel="external">AOL</a></td><td>960</td>
</tr>
</table><br />
上面列舉的都是<a href="http://www.alexa.com/site/ds/top_sites?ts_mode=global&lang=none" rel="external">Alexa全球排名前100的站點</a>，它們的首頁寬度為950px/960px。除了微軟的<a href="http://live.com/" rel="external">Live Search</a>，這些站點有個共同特點：頁面結構較複雜，都可以認為是門戶型網站。<br /><br />

再來看看<a href="http://google.com/" rel="external">Google</a>，<a href="http://youtube.com/" rel="external">YouTube</a>，<a href="http://facebook.com/" rel="external">Facebook</a>，<a href="http://flickr.com/" rel="external">Flickr!</a>，<a href="http://ebay.com/" rel="external">eBay</a>等知名站點，它們的首頁寬度沒什麼固定規律，共同的特點是：功能專一，頁面結構相對簡單。<br /><br />

根據上面的簡單分析可以認為：當搭建頁面結構複雜的門戶型網站時，開發工程師們不約而同地都選擇將頁面寬度定為950px/960px。<br /><br />

這是一件很有趣的事情，為什麼要選擇這個寬度呢？這個寬度值究竟有什麼魔力？<br /><br />

<strong class="A_strong">神奇的960</strong><br /><br />

設計師們對蘋果情有獨鍾。在 1024 x 768 的分辨率下，打開Firefox：<br />
<span style="background:url(/uploads/article/images/grid_system_apple.png) no-repeat 50% 0;height:373px;display:block"></span><br />

自然狀態下，Firefox窗體的大小約為 974 x 650. 減掉左右兩邊7px的邊框，網頁的實際大小為上圖中的紅色部分，高寬為 960 x 650。<br /><br />

有趣的960就這樣出現了。是的，可以認為一切就這麼簡單。柵格系統最早出現在平面設計領域，設計師們愛用蘋果，蘋果下瀏覽器的默認寬度為960px，於是960就這麼“自然”地出現了。<br /><br />

<strong class="A_strong">數字背後的奧妙</strong><br /><br />

上面的“自然”出現，細究自然是不讓人信服的。蘋果系統的設計者們在沒有喝醉酒的情況下選擇了960，而不是其它什麼1000之類的整數，自然另有奧妙。<br /><br />

科學界有很多問題都可以歸結到數學問題上，我們也從數學著手：
<img src="http://waterlily-lsl.com/uploads/article/images/960_formula.png" alt="960" /><br /><br />

960可以分解為2的6次方乘以3和5, 這使得960可以分割成以下寬度的整數倍：
<p class="exemplify">
2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 32, 40,
48, 60, 64, 80, 96, 120, 160, 192, 240, 320, 480</p><br />
共26種（26 = 7 * 2 * 2 - 2, 減去2是去掉1和960自身），我們標記為：
<p style="background:#714b6e;padding:5px;border:1px solid #ecc8e4">
N(960) = N(2^6 * 3 * 5) = 26
</p><br />
同理可以得到：
<p class="exemplify">
N(480) = N(2^5 * 3 * 5) = 6 * 2 * 2 - 2 = 22<br />
N(750) = N(2 * 3 * 5^3) = 2 * 2 * 4 - 2 = 14<br />
N(800) = N(2^5 * 5^2) = 6 * 3 - 2 = 16<br />
N(1000) = N(2^3 * 5^3) = 4 * 4 - 2 = 14<br />
N(1024) = N(2^10) = 11 - 2 = 9<br />
N(1920) = N(2^7 * 3 * 5) = 8 * 2 * 2 - 2 = 30
</p><br />
根據直覺（嚴格證明也不難，不過還是留給數學系的學生去證明吧），我們得到一個有趣的結論：<br /><br />
要使得N(width)最大，width的取值必須是 …，480，960，1920， …

N越大，可組合的寬度值就越多。<strong class="A_strong">對柵格系統來說，這意味著越靈活</strong>！

目前絕大多數顯示器都支持 1024 x 768 及其以上分辨率，480太窄，1920則太寬（太寬也不利於閱讀），因此960就成為網頁柵格系統中的最佳寬度了。（補充：480可以應用在Flash的柵格設計中）

細心的你也許會記得，本文開頭列舉的寬度值中，950也出現了好幾次。950是怎麼來的？和960是啥關係？這些疑問，請關注本系列的下一篇文章。<br />]]></description>
            <author>睡蓮</author>
            <pubDate>Fri, 24 Oct 2008 20:34:53 +0200</pubDate>
        </item>
    </channel>
</rss>

