標籤:pre 字型 action ems 空格 提交 put 顯示 背景
1.表現各標籤的特徵 <img>中的src(source)即為屬性 屬性都是以“屬性名稱 = 值”的形式出現 屬性的值建議用引號括起來 屬性建議均以索引值對的形式括起來 一個標籤可有多個屬性,用空格分開
2.文法 <img src=“URL” /> alt屬性(顯示圖片內容) border屬性(圖片外側相框寬度,預設像素) width屬性 height屬性 相對路徑
3.常見屬性:size、width、align(left,right,center)、noshade、color
4.預定義格式文本:<pre></pre> 通常保留空格和換行,文本以等寬字型呈現(電腦代碼)
5.HTML連結:
1)連結到另一文檔 <a href="MyFirstHTML.htm">跳到指定網頁</a>
2)跳轉到指定地方 <a name="上面" href="#下面">跳到下面</a> <a name="下面" href="#上面">跳到上面</a> 一個圖片標籤,跳到另一個地方顯示圖片(串連指向另一個圖片地址)
6.body屬性:
1)(後面用樣式表,樣式表強大的多) <body text="white"> text屬性(文本的顏色) <font color=“black”>我很帥啊</font></br />(隨便玩的深水炸彈) link屬性(串連的顏色)(如果把這個改成白色誰都看不見…很無語啊) alink屬性(active 點擊的時候串連的顏色) vlink屬性(visited點擊之後的顏色) bgcolor屬性(背景顏色) background屬性(背景圖片,平鋪)
2)無序列表unorder(圓點)(<ul><li>第一個</li><li>第二個</li></ul>) square(方塊) circle(小圓圈) disk(小圓點) 有序列表order(數字)(<ol><li>第一個</li><li>第二個</li></ol>) 通過type屬性來改變 自訂欄表 <dl>項目號,解釋<dt>c#</dt><dd>很基礎的內容</dd></dl>
7.HTML表格——文法
<table border=“1”>
<tr>
<td>儲存格內容</td>
</tr>
<tr> … …
</table>
基本屬性:
<table> bgcolor(背景顏色)、border(邊框), bordercolor(邊框顏色)、cellspacing(儲存格之間間隔),cellpadding(儲存格與內容之間間隔)、width(寬)、height(高)
<td> align、valign、bgcolor、width、height、colspan、rowspan
8.form
<form>的常用屬性 action 表示提交的目標伺服器
method 提交的方法get、post get(預設,以url提交,就是以地址欄的方式提交) post(通過報文提交)
9.form中常用標籤(包括按鈕標籤)
文字框標籤 <input type = “text“ />
密碼框標籤 <input type = “password” />
請輸入密碼:<input type="password" name="pwd" value="" /><br />
文本域標籤 <textarea>內容</textarea> 屬性rows(行)和cols(列)
提交按鈕標籤 <input type=“submit” />(如果添加name就提交了) <input type="submit" name="btn" value="提交" /><br />
重設按鈕標籤 <input type=“reset” />(重設,可以添加value)
按鈕標籤 <input type=“button” /> <input type="button" value="按鈕" onclick="alert(‘不要亂按‘)" />
映像標籤 <input type=“image” />
複選框標籤(有name才能提交) <input type=“checkbox” /> <input type=“checkbox” name=“ch1” value=“chone” checked=”checked“ />文字
選項按鈕簽(沒name點不了) <input type=“radio” />input type=“radio” name=“ra1” value=“raOne” checked=“checked“ />男(預設加checked=“checked”)
檔案選擇標籤 <input type=“file” /> <input type=“file” name=“f1” value=“fOne” />各個瀏覽器不同(必須要有value就業班講)
10.列表標籤
<select>(name在這加才能提交) <option>< /option>(Items) </select> <option value="0">@itcast.com</option>
屬性size(1或非1)(listbox)
屬性multiple(多選)
屬性value和selected(預設誰是第一個)
html基本的內容