?? 3_htmljdbc學(xué)習(xí)筆記.txt
字號:
2004-9-9 星期四 陰
1. HTML結(jié)構(gòu)
答:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- 1) 申明這個頁面的HMTL版本為4.01;
2) “EN”指明DTD中語言是英語;
-->
<html>
<head>
<!--head元素包括當(dāng)前頁面中信息,例如標(biāo)題、用于搜索引擎中的關(guān)鍵字以及其它一些不會被認(rèn)為是頁面內(nèi)容的數(shù)據(jù)-->
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html">
<meta name="author" content="John">
<meta name="keywords" content="web development">
<!--元數(shù)據(jù),被設(shè)計幫助用于搜索引擎檢索頁面-->
<title>HelloWorld Test</title>
<!--頁面標(biāo)題,會顯示在瀏覽器標(biāo)題欄內(nèi)-->
</head>
<body>
Hello World!
</body>
</html>
整個頁面分成三部分:
1) 一行包括HTML版本信息的內(nèi)容;
2) 報頭聲明區(qū)域;
3) 頁面主要部分,包括頁面的實際內(nèi)容。
2. 基本的HTML標(biāo)記
答:1) Headings(標(biāo)題): <h1>This is a heading</h1>;
2) Paragraphs(段落): <p> This is a paragraph</p>;
3) Line Breaks(換行): This <br> is a para <br> graph with line breaks;
4) Comments in HTML(注釋): <!-- This is a comment -->;
3. HTML 文本格式
答:1) <b>: 粗體;
2) <big>: 大號;
3) <em>: 強調(diào);
4) <i>: 斜體;
5) <small>: 小號;
6) <strong>: 加強;
4. HTML 列表
答:1) 無序列表(Unordered Lists)
<ul><li>Coffee</li><li>Milk</li></ul>
2) 有序列表(Ordered Lists)
<ol><li>Coffee</li><li>Milk</li></ol>
3) 自定義列表(Definition Lists)
<dl><dt>Coffee</dt><dd>Black hot drink</dd></dl>
5. HTML 表格
答:1) 表格
<table border="1">
<tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr>
<tr><td>row 2, cell 1</td><td> </td></tr>
</table>
2) 表頭
<table border="1">
<tr><th>HEading</th><th>Another Heading</th></tr>
<tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr>
<tr><td>row 2, cell 1</td><td>row 2, cell 2</td></tr>
</table>
6. HTML 框架
答:1) <frameset>: 定義框架集;
2) <frame>:定義子窗體(一個框架);
3) <noframes>: 定義一個非框架區(qū)域;
4) <iframe>: 定義一個內(nèi)嵌子窗體;
5) 示例:
<frameset cols="25%, 75%">
<!-- <frameset cols="100, *"> -->
<!-- <frameset cols="100, 300"> -->
<frame src = "frame_a.htm">
<frame src = "frame_b.htm">
</frameset>
7. HTML 表單和輸入
答:1) 表單格式: <form action="..." method = "...">...</form>
a. action: 表單的處理頁面,例如:action="Hello.jsp"
b. method: Get,Post.
2) 輸入類型:
a. 文本框:<input type="text" name="firstname">
b. 密碼:<input type="password" name="pwd" size=10 maxlength=8>
c. 單選按鈕:<input type="radio" name="sex" value="male">Male
d. 復(fù)選框:<input type="checkbox" name="bike">Bike
e. 按鈕:<input type="button" value="Hello world!">
f. 提交按鈕:<input type="submit" value="Submit">
g. 重置按鈕:<input type="reset" value="Reset">
h. 下拉框:<select name="cars">
<option value="Popo">Popo
<option value="Viso">Viso
</select>
i. 文框域:<textarea rows="10" cols="30"></textarea>
8. HTML 表單提交方法
答:1) GET: 客戶端的表單請求數(shù)據(jù)被編碼進(jìn)地址。服務(wù)器端通過環(huán)境變量接收數(shù)據(jù)。
2) POST: 請求數(shù)據(jù)包括頭部和主要部分。
1) GET方法適合數(shù)據(jù)小于256個字符, 主要目的是查找。
2) POST方法應(yīng)該被用于請求將會導(dǎo)致服務(wù)器端狀態(tài)的永久改變。
9. HTML 圖像
答:1) 普通圖像:<img src="enterinfo.gif" alt="Enterinfo Studio" width="200" height="100">
2) 背景圖像:<body background="enterinfobg.gif">
3) 圖片鏈接:<a href = "http://www.enterinfo.net"><img border="0" src="enterinfo.gif" width="200" height"100"></a>
10. HTML 多媒體
答:1) 音頻設(shè)備或音頻播放器
<embed src="lzh.mp3" height=160 width=244 controls="bigconsole" autostart="false" nosave="true" loop="true"></embed>
2) 背景音樂
<bgsound src="lzh.mp3" loop="10">
2004-9-10 星期五 陰
1. CSS在頁面的位置
答:1) 外部文件引用:
<head>
<link rel="stylesheet" type="text/css" href="enterinfo.css">
</head>
2) 頁面頭部
<head>
<style type="text/css">
body{background-color:red}
</style>
</head>
3) 作為屬性
<p style="color:red">This is a paragraph</p>
2. CSS語法
答:CSS由三部分組成:選擇值(selector), 屬性(property)和對應(yīng)的值(value)
示例:
p{text-align:center;color:blue;font-family:arial} /* 多個屬性間以分號分隔 */
h1,h2,h3,h4,h5,h6{color:green} /* 多個選擇值間以逗號分隔 */
3. 選擇值中的class和id
答:1) 類屬性(Class attribute):
p.right {text-align:right} /* 定義類"right" */
p.center{texta-align:center} /* 定義類"center" */
<p class="right>This paragraph will be right-aligned. </p>
<p class="right>This paragraph will be right-aligned. </p>
2) ID 屬性
*#ei{color:green} /* 定義id */
<p id="ei">A new paragraph starts from here.</p>
4. web是如何工作的?
答:1) Web服務(wù)器: 一個Web服務(wù)器就像一個計算機程序監(jiān)聽從Browser發(fā)出的請求然后響應(yīng)這些請求。
2) 請求:客戶端通過HTTP協(xié)議請服務(wù)器返回一個存儲在服務(wù)器端的文檔,客戶端和服務(wù)器端使用TCP/IP(或FTP)協(xié)議進(jìn)行會話。
3) 響應(yīng):當(dāng)服務(wù)器端收到HTTP請求,它定位到相關(guān)的文檔并且返回它。
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -