現在,開始製作你的第一個HTML文件。
多媒體文件(HTML)其實只是很平常,很普通的文字檔。
你可以用你所熟悉的文字編輯器來編輯它,例如PE2、
VI等,不一定要用其它的新穎編輯器。只要透過一些
簡單的標注,就讓您的文章生動、活潑了起來,這就
是HTML的特色。
下面是個簡單的開始:
-----------------------------------------------------------
<TITLE>簡單的HTML文件</TITLE>
<H1>這裡放個標題</H1>
歡迎進入全球資訊網 !
這是第一段落的結束。<P>
另一個段落的結束在這兒<P>
-----------------------------------------------------------
看看它在WWW裡變成什麼樣子:上面五行就是HTML原始的樣子,那些大於(<)、小於(>)符號和 來於其中的英文字,就是所謂的「標注」(tags)。正因為有這些標 注,這WWW的讀者看到多采多姿的文章,我們的流覽器(例如Mosaic 或Cello),會依照不同的標注,產生許多不同的效果。
<Title>和</Title>記號中間所包住的文字,就是這一篇文章的
主題,它一定在文章的最前面,也會顯示在Mosaic最上面Title的欄
位。而所有的< >和夾在其中的文字都不會顯示出來。被<H1>和
</H1>所夾在中間的文字,是文章裡的標題。它可以標注出六個層級
的標題,從<H1>、<H2> 、、、、、到<H6>,也可以說<H3>是<H2>的
次標題。差別在於標題的文字會比次標題來得大些、粗些、更顯
眼。
<P>是HTML格式中特有的段落句點。在HTML格式裡我們不需要在 意文章每行的寬度,不必擔心文字是不是太長了而被截掉;它會依 視窗的寬度而做自動轉折到下一行的工作。因此,在原始文件中的 <P>,就是指出了這兒告一段落,下面的文字換行從頭再開始。如果 沒有遇到<P>這個符號,它就會把所有之前的文字都擠在一個段落 裡,不遇到視窗的邊界是不會換行的。我們在原始檔中的換行動 作,若沒標記,是會被視而不見的。
太多的空白,不論二個或一行,都會被視為沒有。還有在< >中 的文字是不拘大小寫的,可以是<Title>也可以是<title>或<TITLE> 都可以。更可以發現有些標注是成對出現的,尾隨在後的會比前頭 的多了個"/"。
HTML文章的另一個特色,就是在文章段落間任意地跳躍。可以
跳到另外一台電腦上的文件,也可以跳到文章的另一個段落。
下面是它標注的格式。
基本上,它會是這一個樣子:
<A href="filename.html" >Link to filename </a>
這表示我們將看到"Link to filename"會變色並加下底線出現
在Mosaic中,當遊標移到上面時,會從箭頭轉成手指,這表示
你可以在這兒壓一下:會跳躍到filename.html的文章裡。這很
簡單,我們只要把目的地放進" "當中就可以了。
(別忘了加上路徑。)
當它要跳躍到別台主機時," "中的格式是這樣子的。
"Scheme://host.domain[:port]/path/filename"
scheme可以是file、http、gopher、WAIS,這要視該主機提供
ftp節點。
例如:想連結這篇文章的英文原板,就寫成下面那樣:
<A HREF="http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimer.html">
NCSA's HTML Primer </A>
[:port]代表的是用那一個通訊埠溝通,defult是80,通常不需
指明,但有些站比較不一樣,例如成大圖書館,就需加上
http://liphp.lib.ncku.edu.tw:5000/
除了跳到另一個HTML文件,也可以在一篇文章內隨心所欲地跳躍。
首先看看它在" "引號中的表示方式
<A HREF="#clients">Jump to Clients </A>
Jump to Clients」會變色加上底線並連接到一篇文章中有標
注<A NAME= "clients"> Clinets </A>的地方。
如果這兩個標注是在不同的文件內,則表示方法有點兒改變。
若Jump to Clients 在A文章,而Clents 在B文章中,則要改
<A HREF="filenameB#clients"> Jump to Clients </A>
這樣一來,當我們在A文章中按下Jump to Clients 就會跳到B
文章的Clients這個字,而不是B文章中的其它地方。
<UL> <LI2> apples <LI> bananas </UL> The output is: apples bananas要注要若使用不同的流覽器(Mosaic,Cello,Windeb)就可能會 有不同的效果。也許是圓形,或是一槓加在每一行的起始。
<OL> <LI> oranges <LI> peaches <LI> grapes </OL> The list looks like this online: 1. oranges 2. peaches 3. grapes
<DL> <DT> National Center for Supercomputing Applications <DD> NCSA is located on the campus of the University of Illinois at Urbana-Champaign. NCSA is a one of four member institutions in the National Metacenter for Computational Science and Engineering. <DT> Cornell Theory Center <DD> CTC is located on the campus of Cornell University in Ithaca, New York. CTC is another member of the National Metacenter for Computational Science and Engineering. </DL> The output looks like this: National Center for Supercomputing Applications NCSA is located on the campus of the University of Illinois at Urbana-Champaign. NCSA is a one of four member institutions in the National Metacenter for Computational Science and Engineering. Cornell Theory Center CTC is located on the campus of Cornell University in Ithaca, New York. CTC is another member of the National Metacenter for Computational Science and Engineering.
<UL>
<LI> A few New England states:
<UL>
<LI> Vermont
<LI> New Hampshire
</UL>
<li> One Midwestern state:
<UL>
<LI> Michigan
</UL>
</UL>
The nested list is displayed as
A few New England states:
Vermont
New Hampshire
One Midwestern state:
Michigan
<PRE>
#!/bin/csh
cd $SCR
cfs get mysrc.f:mycfsdir/mysrc.f
cfs get myinfile:mycfsdir/myinfile
fc -02 -o mya.out mysrc.f
mya.out
cfs save myoutfile:mycfsdir/myoutfile
rm *
</PRE>
display as:
#!/bin/csh
cd $SCR
cfs get mysrc.f:mycfsdir/mysrc.f
cfs get myinfile:mycfsdir/myinfile
fc -02 -o mya.out mysrc.f
mya.out
cfs save myoutfile:mycfsdir/myoutfile
rm *
<blockquote>
Let us not wallow in the valley of despair. I say to you, my
friends, we have the difficulties of today and tomorrow. <P>
I still have a dream. It is a dream deeply rooted in the
American dream. <P>
I have a dream that one day this nation will rise up and
live out the true meaning of its creed. We hold these truths
to be self-evident that all men are created equal. <P>
</blockquote>
The result is
Let us not wallow in the valley of despair. I say to you, my friends, we
have the
difficulties of today and tomorrow.
I still have a dream. It is a dream deeply rooted in the American dream.
I have a dream that one day this nation will rise up and live out the true
meaning of its creed. We hold these truths to be self-evident that all men
are
created equal.
<ADDRESS> A Beginner's Guide to HTML / NCSA / pubs@ncsa.uiuc.edu </ADDRESS> The result is: A Beginner's Guide to HTML / NCSA / pubs@ncsa.uiuc.edu
範例如下:
< 在螢目上會是 <
> 在螢目上會是 >
& 在螢目上會是 &
尚有其他特殊字元(ISO 8859-1)從CERN的列表中得知。
若未加特別注解,此段的文字會被置於圖形的下面。
若想要文字置於圖形的上面,就得加上align=top
的參數:<IMG ALIGN=top SRC="filename.GIF">
如果圖很大,幾乎塞滿整個視窗,你應該在圖形插入前
加上<P>的標注。
<A HREF="filename.GIF">link anchor</A>
圖檔的格式可以是GIF.TIEF.JPEG.RGB 或HDF格式。