| 0 意見 ]

HTML排版:定義清單之dl, dt, dd
定義清單是什麼?它跟ol, ul有什麼不一樣?dl, dt, dl 這三個標籤形影不離,卻又少人知道,但是它卻很好用!
前兩篇提到ol, ul 與 li,這個有無序號清單的玩意,與dl, dt, dd最大不同的地方在於,ol, ul, li 列出的清單只有條列式,而dl, dt, dd 稱為定義清單是因為同時有清單排列的模式,同時也附上說明,就好像左邊寫:一、xxxxxxxx,右邊寫xxxxxxxx是什麼xxxxxxxxx。項目名稱與項目說明同時存在,不再只是單純的條列清單。點我看範例!
範例一當中是平常狀態,在沒有任何其他設定時的模樣。或許你會很好奇,為什麼它自己會隔開,那麼請看範例二,範例二我設定了dl的邊框,每個dl的間距都有預設值,使你排列的時候不用刻意再做邊距設定,很多元素本身就有不同的 margin 邊距值 與 padding 內距值,如果仔細看,其實之前的ol, ul 範例也有。我們再看看範例三,範例三設定了 dt 與 dd 的邊框,讓你明白看見為什麼它們倆會一左一右,dd 因為margin-left的關係所以排列的時候會被往右推。
以下為使用dl, dt, dd如範例一的原始碼:

dt 清單項目‧壹
dd 清單說明‧壹

先使用dl標籤分別包住 dt 與 dd,一般來說dt在上,dd在下,原因是因為水平閱讀是由左至右,清單項目在前,清單說明在後。當然,你高興的話可以顛倒。
在這裡順便說明margin, padding 以及 border 的簡單觀念:margin 稱為邊距或是間距,元素邊框以外的距離;padding 稱為內距,內容與邊框之間的距離;border 則是邊框,處於margin 與 padding 之間。所以當我們看到範例三的 dd 邊框左邊空了一塊,是因為dd 的 左邊 margin 值的關係,而讓瀏覽網頁的人以為是一左一右。

| 0 意見 ]

導覽連結:
generateBreadcrumbs();

-> 年份: 2007 -> 月份: 03 -> 標題: Blogger 資料來源用法與整理 (Site Feed Usage)
2007-03-10

Blogger 資料來源用法與整理 (Site Feed Usage)
在 Blogger 介紹過的眾多 Hack 之中,詢問度最高、用的人最多的就是「最新回應」或「最新文章」,當然,我之前的文章也介紹過,程式碼都一樣,稍稍改一下 Feed 的來源就可以了。包含上一篇顯示相關文章的 Hack 也有提到,Blogger 提供很多種的 Feed 來源,上一篇用的是特定標籤的 Feed,而「最新回應」用的是 Comment 的 Feed,「最新文章」當然就是用整個 Blog 最基本的 Feed,最後一類比較冷門,叫做 Pre-post Comment,Blogger 有「意見管理」的功能,也就是「留言要經版主審核才能刊出」,如果有啟用這個功能,這個 Feed 就可以列出還沒刊出的留言。這四類的 Feed URL 整理如下:
新文章的 Feed(以下幾種都有一樣的效果):
http://你的Blog網址/feeds/posts/類型
http://你的Blog網址/rss.xml
http://你的Blog網址/atom.xml
http://beta.blogger.com/feeds/你的BlogID/posts/類型最新回應留言的 Feed:
http://你的Blog網址/feeds/comments/類型
http://beta.blogger.com/feeds/你的BlogID/comments/類型特定分類標籤的 Feed:
http://你的Blog網址/feeds/posts/類型/-/標籤
http://beta.blogger.com/feeds/你的BlogID/posts/類型/-/標籤未審核的回應留言的 Feed:
http://你的Blog網址/feeds/特定文章ID/comments/類型
http://beta.blogger.com/feeds/你的BlogID/特定文章ID/comments/類型
以上有些屬性需要自己調整,說明如下:
http://你的Blog網址:如果沒有用 Customized Domain Name,通常應該是 http://名稱.blogspot.com。這裡有個小技巧,如果在樣版裡面常常會用到「自己」的網址當作變數或 Feed URL,可以直接省略,也就是說 "http://你的Blog網址/" 等同於 "/",絕對路徑可以用相對路徑來表示。
類型:指的是 Feed 內容的類型,可以填的值有 default, full 和 summary,前兩個是提供完整的 Feed 內容,summary 則是僅提供部分(應該會比較快)。
你的BlogID:注意一下你的網址列,尤其在你登入編輯的時候看得到,找 blogID= 後面那個字串就是。這裡有官方說明
特定文章ID:在閱讀特定文章,要留言回應的時候注意一下網址列也可以看到,找 PostID= 後面那個字串就是。
標籤:你想要看的分類標籤名稱(大小寫有分別喔)。如果想同時看多個標籤的 Feed,也可以用 "標籤1/標籤2" 來取代(代表的是,同時有這兩個標籤的所有文章)。注意,如果有標籤名稱中間有空白,在整個網址一定要加雙引號,手動敲網址的話也可用 %20 或是 + 來替代。
以上是所有 Blogger 提供的 Feed URL,這些 Feed 網址還有一些參數可以下喔!基本常識:如果要在網址後面加參數,第一個參數和網址字串中間要加一個 ? 當連字號,如果後面不止一個參數,參數之間要用 & 當作連接符號。下面先介紹一些參數,連接的特殊符號在範例裡再看:
alt=格式:可以把 Feed 內容的格式改成 RSS 2.0 (rss),預設是 ATOM (atom) 的格式,也支援 JOSN (json-in-script)。
start-index=N:設定 Feed 內容的啟始文章標號,如果 Feed 裡面有十篇,index N 設成五的話,那就只會顯示從第五篇開始後面的內容。
max-results=N:設定 Feed 內容最大的數量。值好像沒有上限(可以搞個 50 或 100 的,相對地文章多顯示會比較慢),預設沒有這個參數的話,內容是 20 篇。
orderby=排序方法:設定 Feed 內容依照發文時間 (published) 排序,或是「更新時間」(updated) 來排序,如果用 published 這個參數不管舊文章怎麼更新,也不會干擾你的 RSS Feed 內容。
好,怎麼混用以上的 Feed URL 加上屬性和參數呢?以下有幾個範例:
範例一,顯示我的最新文章,強制用 RSS2.0、上限十篇完整內容: http://abintech.blogspot.com/feeds/posts/full?alt=rss&max-results=10
範例二,顯示我的最新回應,顯示從第五篇開始,總共顯示五篇部分的內容就好: http://abintech.blogspot.com/feeds/comments/summary?start-index=5&max-results=5
範例三,顯示同時有標籤 BLOGGER HACK 和 CSS 的文章: http://abintech.blogspot.com/feeds/posts/summary/-/CSS/BLOGGER+HACK
有很多的 Hack 都是利用這些 Feed URL 提供的內容來做變化,只要善用 Javascript 或是 JSON 和範例,相信可以做出各式各樣符合自己需求的 Hack,搭配 CSS 語法和 Blogger 的樣版彈性,自己的 Blog 要打造成什麼樣子都沒問題!
參考文章:Blogger Beta Feeds修正RSS Feed 依發文時間排序

| 0 意見 ]

一般連結:要用單引號(')將整個字串包起來,再用雙引號(")包個別的文字,用加號(+)連接字串和資料。網址的&符號必須以(&)取代。 
連結文字連結文字

JavaScript 連結:function的文字參數要用(\")包起來。 
連結文字
連結文字

| 0 意見 ]

Widget Tags for Layouts


The basic tags for creating widgets are described in Page Element Tags for Layouts. If you just want to use the Page Elements tab to work with everything, then that's all you need to know. However, if you want more fine-grained control, this article describes what you can put inside a widget, if you're working in the "Expand Widget Templates" mode of the Edit HTML page.
The first thing to do is to add a closing tag. So this:


becomes this:


Now with that out of the way, let's talk about what you can put between those tags.

Includes

Widget content is contained in "includable" sections, which have this format:

    [insert whatever content you want here]

The attributes are as follows:
  • id: (Required) A unique identifier made up of letters and numbers.
  • var: (Optional) An identifier made up of letters and numbers, for referencing data within this section. (See the data section below.)
Each widget must have one includable with id='main'. This will usually contain most or all of the content that will display for this widget, and in many cases it will be all you need.
If you make more includables with different IDs, they will not be displayed automatically. However, if you make an includable with id='new', then you can reference it in your main includable with and it will display that way.
The attributes for the b:include tag are as follows:
  • name: (Required) An identifier made up of letters and numbers. It must match the ID of an existing b:includable in the same widget.
  • data: (Optional) An expression or peice of data to pass on to the includable section. This will become the value of the var attribute in the includable.
Here is a simple example demonstrating the use of b:includable and b:include. Loops and data are described later in this article. The main thing to understand here is how the "main" section includes the "post" section within it. It passes along a post that it calls "i" and the included section references it as its var "p", then prints the title.

   
      
   




   Title:

Includes are most useful if you have a section of code that you want to repeat multiple times in different places. You can just write the code once, put it inside a b:includable, then use b:include wherever you want it to appear. If you don't need to do that, then you can just stick with the single main includable and not worry about the rest. (Note that the main includable is included automically -- is unnecessary.)

Data

The data: tag is arguably one of the most important ones, since it's the avenue that brings in all of your actual content. Some examples of this tag are:


or

The first example is simplest, and will work in most widgets, since most widgets have titles. All it does is print out the title of the widget. The second example shows a more complex variable, from which we select a particular component. A photo, say in the context of a profile widget, may have components such as url, height, and width. Using the "." notation indicates that we want the URL for this photo, rather than a URL from something else.
There is a great deal of data that you can access with the data: tag, and it varies depending on which widget you're working with. We've got a comprehensive list to help you find the data you need.

Loops

The b:loop tag lets you repeat a section of content multiple times. This is most commonly used for printing out each post in a list of posts for a given page, or each comment, or each label, etc. The general format for using loops is this:

   [repeated content goes here]

The 'identifier' part can be any name you choose, and will be used to stand in for each new item in the list, each time through the loop. A common convention is to simply call this "i". The set of data you specify for the values can be any piece of data described in the data tags article as being a list of items. For instance, in the blog posts widget, posts is a list. Code like the following will loop through each post, printing out the title for each one, with header tags around it.

   


Notice how "i" takes on the value of each post in turn, so you can get the title from each one.

If / Else

You can use the b:if and b:else tags to display content in some places but not others. The general format is this:

   [content to display if condition is true]

   [content to display if condition is false]

The b:else tag is optional. Without it, the result will be either the content listed in the b:if section or nothing. The closing is required in each case, however.
For "condition" you can put in anything that evaluates to either true or false. Some data tags are simply true/false values on their own, e.g. allowComments on a post. With other pieces of data, you can compare them with specific values to get a true or false. Here are some examples:
  • True if the current post is set to show backlinks.
  • True if the current page is an item page (post page).
  • True if this is not Fred's display name.
  • True if the current post has more than one comment.

| 0 意見 ]


Widget Tags for Layouts

Print
The basic tags for creating widgets are described in Page Element Tags for Layouts. If you just want to use the Page Elements tab to work with everything, then that's all you need to know. However, if you want more fine-grained control, this article describes what you can put inside a widget, if you're working in the "Expand Widget Templates" mode of the Edit HTML page.
The first thing to do is to add a closing tag. So this:


becomes this:


Now with that out of the way, let's talk about what you can put between those tags.

Includes

Widget content is contained in "includable" sections, which have this format:

    [insert whatever content you want here]

The attributes are as follows:
  • id: (Required) A unique identifier made up of letters and numbers.
  • var: (Optional) An identifier made up of letters and numbers, for referencing data within this section. (See the data section below.)
Each widget must have one includable with id='main'. This will usually contain most or all of the content that will display for this widget, and in many cases it will be all you need.
If you make more includables with different IDs, they will not be displayed automatically. However, if you make an includable with id='new', then you can reference it in your main includable with and it will display that way.
The attributes for the b:include tag are as follows:
  • name: (Required) An identifier made up of letters and numbers. It must match the ID of an existing b:includable in the same widget.
  • data: (Optional) An expression or peice of data to pass on to the includable section. This will become the value of the var attribute in the includable.
Here is a simple example demonstrating the use of b:includable and b:include. Loops and data are described later in this article. The main thing to understand here is how the "main" section includes the "post" section within it. It passes along a post that it calls "i" and the included section references it as its var "p", then prints the title.

   
      
   




   Title:

Includes are most useful if you have a section of code that you want to repeat multiple times in different places. You can just write the code once, put it inside a b:includable, then use b:include wherever you want it to appear. If you don't need to do that, then you can just stick with the single main includable and not worry about the rest. (Note that the main includable is included automically -- is unnecessary.)

Data

The data: tag is arguably one of the most important ones, since it's the avenue that brings in all of your actual content. Some examples of this tag are:


or

The first example is simplest, and will work in most widgets, since most widgets have titles. All it does is print out the title of the widget. The second example shows a more complex variable, from which we select a particular component. A photo, say in the context of a profile widget, may have components such as url, height, and width. Using the "." notation indicates that we want the URL for this photo, rather than a URL from something else.
There is a great deal of data that you can access with the data: tag, and it varies depending on which widget you're working with. We've got a comprehensive list to help you find the data you need.

Loops

The b:loop tag lets you repeat a section of content multiple times. This is most commonly used for printing out each post in a list of posts for a given page, or each comment, or each label, etc. The general format for using loops is this:

   [repeated content goes here]

The 'identifier' part can be any name you choose, and will be used to stand in for each new item in the list, each time through the loop. A common convention is to simply call this "i". The set of data you specify for the values can be any piece of data described in the data tags article as being a list of items. For instance, in the blog posts widget, posts is a list. Code like the following will loop through each post, printing out the title for each one, with header tags around it.

   


Notice how "i" takes on the value of each post in turn, so you can get the title from each one.

If / Else

You can use the b:if and b:else tags to display content in some places but not others. The general format is this:

   [content to display if condition is true]

   [content to display if condition is false]

The b:else tag is optional. Without it, the result will be either the content listed in the b:if section or nothing. The closing is required in each case, however.
For "condition" you can put in anything that evaluates to either true or false. Some data tags are simply true/false values on their own, e.g. allowComments on a post. With other pieces of data, you can compare them with specific values to get a true or false. Here are some examples:
  • True if the current post is set to show backlinks.
  • True if the current page is an item page (post page).
  • True if this is not Fred's display name.
  • True if the current post has more than one comment.

| 0 意見 ]



ex ea commodo consequat.

dictum bibendum.

ullamcorper augue.

| 0 意見 ]

| 0 意見 ]

Jquery UI v1.7 內建 18種佈景主題 CDN

Jquery UI v1.7預設內建18種佈景主題

隨著Jquery UI版本更新到1.7,Google CDN服務也隨之更新到最新版本。並且,Google 大神也很大方地附加1.7版本內建的主題列表,供開發者取用; 用法: link rel="stylesheet" href="xx.css" 將href 換成下面個別主題的 URL ,就能使用拉!

| 0 意見 ]

轉載
前幾天聽到一個同學在趕 project ,結果他 code 修得亂七八糟,然後改到後來發現想要把 code 恢復成曾經寫過的某個版本,但有的地方是忘記怎麼寫,有的地方則是改起來十分麻煩等等,我想如果他有做好版本控制的話,也許就不會這麼囧了…

有鑑於此,我教了幾個朋友簡單使用 subversion 來作版本控制,也許你會問我為什麼不教 CVS 或 Visual Source Safe 等等,很簡單,「因為我只會 subversion !」當然我本身會的也沒有很多,所以只能稍微簡介一下而已 :p

簡單來說,一般版本控制軟體的架構大致是會有一個貯藏庫(Repository,而不是 database),它用來儲存你每次對整個 project 增加、修改及刪除等等動作,每當你將 project 修改至某一個程度(你可以說是某個版本),就可以利用版本控制軟體把你修改的動作送交(commit)到貯藏庫,把這次的修改定為一次修訂版(revision)。正因為這個貯藏庫記錄了每一次修訂版,所以當你想要從貯藏庫取回(checkout)project 時,可以指定任何一次修訂版本,版本控制軟體會幫你處理好從最初版開始的一切動作,當然,如果你本來就存有 project 的 code ,也可以用版本控制軟體作更新(update)的動作來將你所存的 project 更新到最新的修訂版本。

上述的簡介大致提到了在用版本控制軟體時的基本操作,而我這篇文章主要是要介紹 subversion 這個版本控制系統,關於這個系統我就不多作介紹了,我只會提及在各個平臺要怎麼把上面的動作作出來而已。既然作版本控制需要一個 repository ,這裡介紹兩個在網路上可以找到的 subversion 服務:OpenSVN 及 Google Code 上的 Project Hosting 。這兩個網站你都可以隨意(似乎是如此)建立新的 repository 放你的 project (惟 Google Code 一個 project 的 repository 限制磁碟空間最多只能使用 100 MB),之後的例子會以 Google Code 的 Project Hosting 當作例子示範。

Google Code Project Hosting

在 Google Code 的左側導覽列中點選 Project Hosting 便會來到上面的網頁,這時再點選 Create a new project 就可以填入你 project 的相關資料,這樣 Google Code 就幫你產生了一個 repository 了。設定好之後你只要先知道你 repository 的位址(到你 Project 首頁的 Sources 裡去看,會是 https://<你project名稱>.googlecode.com/svn/)就可以了,同時你也要知道你在 Google Code 的密碼,到右上角的 My Profile -> Settings 裡就會有 Google Code 產生的密碼,這個也要記住,因為當你在 commit 的時候會需要用到。

Source URL

版本控制總需要一個 client-side 的軟體,在 Unix 系的環境裡你安裝好 subversion 相關套件後,就可以在終端機下使用 svn 這個指令來作版本控制,而在 Windows 上,你可以使用一個有圖形化介面的 subversion 軟體:TortoiseSVN,安裝這個軟體後,它就會在你檔案總管的右鍵選單中加入 subversion 的相關指令,相當方便易用。

SVN Checkout安裝好 TortoiseSVN 之後,你可以選擇你要存放 project 的位址,然後在該處按右鍵選 SVN Checkout…,再填入你 project repository 的網址及要儲存的資料夾,輸入完帳號及密碼後, repository 上的檔案就會下載下來了。注意你 repository 下會事先建立好三個目錄:branch、trunk及tags,如果你還不是很熟悉版本控制的話,就先把你的 code 放在 trunk 目錄下就好了,所以在 checkout 的時候網址應該輸入:https://<你project名稱>.googlecode.com/svn/trunk/,然後本地端再輸入你 project 的名稱就好,這樣一來你就有一份本地端的 repository 了。

SVN Checkout...

SVN Commit... 接著,你就可以在這個目錄下放你 project 的資料了,當你決定要 commit 到伺服器上的 repository 時,只要在 project 的目前上按右鍵,選擇 SVN Commit...,這時就會跳出一個對話盒問你要加入或修改哪些檔案,然後也可以讓你填入 log 好記錄這次的修訂版本做了什麼修改,方便日後你要取出某個修定版本時作參考。

如果你在不同的地方都有放一份 repository ,那你每次要修改 project 內容時,都應該先利用 SVN Update 的功能,讓你把 repository 更新到最新的狀態(當然,你也可以選擇要更新到第幾次修訂版 TortoiseSVN -> Update to revision...),這樣當你在作 commit 動作時,才不會出現有不同步的狀況,因而發生 conflict ,那就要再仔細檢查應該如何修改 code 消除 conflict 了。

(待續…)

| 0 意見 ]

傳統範本

| 0 意見 ]



Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.

Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.



| 0 意見 ]