體育生學編程——html學習

來源:互聯網
上載者:User

標籤:html   編程   java   語言   w3c   

HTML學習1、HTML介紹(瞭解即可)HTML (Hyper Text Markup Language):
HTML就是超文字標記語言 (HTML)的簡寫,是最基礎的網頁語言

HTML的版本: 
2.0(IETF)、3.0(W3C)、4.01(W3C)、5.0(W3C)
IETF: Internet Engineering Task Force
W3C:World Wide Web Consortium 

  HTML的特點:
是通過標籤來定義的語言,代碼都是由標籤所組成,代碼不用區分大小寫
由<html>開始,</html>結束
由頭部分<head></head>和體部分<body></body>兩部分組成
頭部分是給HTML頁面增加一些輔助或者屬性資訊,它裡面的內容會最先載入
體部分是真正存放頁面資料的地方

HTML的標籤:
多數標籤都是有開始標籤和結束標籤。例如:<html></html>  <p>段落段落</p>
其中有個別標籤因為只有單一功能,或者沒有要修飾的內容可以在標籤內結束。例如:換行<br /> 分割線<hr />  也可以寫作<br><hr> 斜線可以不寫

 HTML標籤中的屬性:
想要對被標籤修飾的內容進行更豐富的操作,就用到了標籤中的屬性
通過對屬性值的改變,增加了更多的效果選擇
屬性名稱與屬性值之間用“=”串連
屬性值可以用雙引號、單引號、不用引號,一般都會用雙引號(或公司規定書寫規範)
2、頭標籤<head><title>
      頁面的標題
<base>
      頁面超連結的基本屬性
        href:頁面所有超連結預設從這個路徑開始
        target:頁面所有超連結預設的target

<meta>
        頁面描述資訊
        <meta name="keywords" content="Java,.Net,Android,iOS">蜘蛛爬取時看,搜素引擎SEO有關
        <meta http-equiv="content-type" content="text/html; charset=utf-8"> 告知瀏覽器此頁面內容、類型、編碼
        <meta http-equiv="refresh" content="3;url=http://www.maomao.com">三秒後重新整理到某個頁面
3、字型<font>字型標籤<font>:
        <font size=5 color=red>字型標籤樣本</font> 
        簡單顏色可是直接寫對應的英文
        複雜顏色用16進位表示,表現形式#FF0000兩個數為一組,按紅,綠,藍排列
        如:#FF0000表示紅色、#00FF00表示綠色

標題標籤<h1>、<h2> ... <h6>:
        標題是文本中常用的內容,為了方便操作而定義的
        其實就是某個字型大小和粗體的組合
4、列表<dl><dt><dd>無標籤:
        <dl>列表、<dt>標題、<dd>清單項目
數字標籤:
        <ol>列表、<li>清單項目
        type屬性更改項目符號(a A 1 i I)
符號標籤:
        <ul>列表、<li>清單項目
        type屬性更改項目符號(circle
空心圓、disc實心圓、square正方形) 
<span style="font-size:14px;"><dl><dt>公司部門</dt><dd>軟體研發部</dd><dd>財務部</dd><dd>行政部</dd><dl><ol type="i"><li>軟體研發部</li><li>財務部</li><li>行政部</li></ol><ul type="square"><li>軟體研發部</li><li>財務部</li><li>行政部</li></ol></span>
   
5、超連結<a>連結標籤<a>:
<span style="font-size:14px;"><span style="white-space:pre"></span> <span style="font-size:18px;"> <a href="http://www.maomao.com" target="_blank">貓貓學編程</a></span></span>
       href:要連結的地址
        target:顯示位置
<span style="font-size:14px;"><span style="white-space:pre"></span><a name="mark" /></span>
在頁面的某個位置做出標記
<span style="font-size:14px;"><span style="white-space:pre"></span><a href="#mark">跳轉到標記</a></span>
點選連結跳轉到標記位置
6、映像<image>映像標籤<img>:
<span style="font-size:14px;"><span style="white-space:pre"></span><img src="1.jpg" align="right" border="3" alt="圖片解說文字" /> </span>
        src: 圖片路徑
        align: 對齊
        border: 邊框粗細
映像地圖<map>:
        在<img>標籤中使用usemap屬性,指定映像可以用作地圖
        使用<map>及<area>標籤可以把映像的一部分作為超連結
<span style="font-size:14px;"><span style="white-space:pre"></span><img src="Sunset.jpg" alt="圖片解說文字" usemap="#Map" />        <map name="Map"><area shape="rect" coords="50,59,116,104" href="1.html" /><area shape="circle" coords="118,203,40" href="2.html" />        </map></span>

7、架構<frameset>框架組合標籤<frameset>:
        <frameset>中可以放入多個<frame>架構,把頁面分成幾個部分
        <frameset>不能放在body中

<span style="font-size:14px;"><frameset rows="20%,*">        <frame src="1.html" name="top" />        <frameset cols="20%,*"><frame src="2.html" name="left" /><frame src="3.html" name="right" />        </frameset></frameset></span>
rows:框架組合每行的高度
cols:框架組合每列的寬度
src:架構中顯示的頁面
name:架構的名字,可用做超連結的target

內聯架構<iframe>:     
<span style="font-size:14px;"><span style="white-space:pre"></span><iframe src="1.html">抱歉,您的瀏覽器無法顯示iframe標籤</iframe>        <iframe src="2.html">抱歉,您的瀏覽器無法顯示iframe標籤</iframe></span>
        可以在頁面中嵌入另一個頁面
        src:要嵌入的頁面
        innerHTML:如果瀏覽器無法顯示iframe,則會顯示該文本
8、表格<table>表格標籤<table>:
        <caption> 標題
        <tr> 表格中的一行
        <td> 放在<tr>中代表一個單元格
        <th> 類似<tr>通常用在第一行或最後一行
<span style="font-size:14px;"><table border="1" width="40%" > <!-- 40%會歲表單大小變化 -->        <caption>表格標題</caption>        <tr>                <th>姓名</th>                <th>年齡</th>        </tr>        <tr algin=”center”>                <td>張三</td>                <td>23</td>        </tr></table></span>

多行多列<td>:
        colspan屬性:控制一個單元格佔多列
        rowspan屬性:控制一個單元格佔多行 
<thead>、<tbody>、<tfoot>:
        三個標籤都是放在table下,內部可以放tr標籤
        <thead> 表頭,通常用在第一行
        <tbody> 表體,表格中間的內容,可以有多個
        <tfoot> 表腳,通常用在最後一行       


9、表單<form>重要<input>表單標籤<form>:
        內部可以包含文字框、單選、多選、下拉式清單等表單項
        可以把使用者在頁面中的輸入和選擇提交到一個地址
        常用屬性:
        action:提交地址
method:提交方式
<span style="font-size:14px;"><form action="要提交的地址" method="get"><input type="text" name="username"><input type="password" name="password">        </form></span>

輸入項<input>:
        通過指定type屬性可以定義不同的輸入項:
text:普通文字框
password:密碼框
radio:選項按鈕
checkbox:多選按鈕
file:檔案
hidden:隱藏欄位
submit:文本提交按鈕
image: 圖片提交按鈕
reset:重設按鈕
button:普通按鈕
下拉式清單<select>
      預設為單選,multipe屬性指定是否為多選
        size屬性指定顯示個數
        內部用<option>標籤指定其中選項
文本域<textarea>
        rows屬性指定行數
        cols屬性指定列數
標籤<label>
        可以用來方便點擊或者設定快速鍵
        <label><input type="radio"> 男</label>
        <label for="user" accesskey="u">使用者名稱(u)</label>
        <input type="text" id="user" />
        
<span style="font-size:14px;"><form action="success.html" method="get"><table width="50%" border="1" cellpadding="10" cellspacing="0"><tr><td>使用者名稱:</td><td><input id="user" name="username" type="text"></td></tr><tr><td>密碼:</td><td><input name="password" id="pass"type="password"></td></tr><tr> <td colspan="2" align="center"><label><input type="radio" name="gender" value="male">男</label><label><input type="radio" name="gender" value="female">女</label></td></tr><tr><td colspan="2" align="center"><label><input type="checkbox" name="interest" value="smoke">抽煙</label><label><input type="checkbox" name="interest" value="drink">喝酒</label><label><input type="checkbox" name="interest" value="tangtou">燙頭</label></td></tr><tr><td colspan="2" align="center"><input type="file" name="portrait "></td></tr><tr><td>城市</td><td><select name="city"><!--multiple="multiple" size="10"  --><option>-請選擇城市-</option><option value="bj">-北京-</option><option>-廣州-</option><option>-成都-</option><option>-上海-</option></select></td></tr><tr><td>自我介紹</td><td><textarea name="rusume" rows="10" cols="30"></textarea></td></tr><tr><td colspan="2" align="center"><input type="submit" value="註冊"><input type="image" src="../image/reg.gif"><input type="reset" value="重填"><input type="button" value="普通按鈕" onclick="alert('你好!')"></td></tr><label accesskey="u" for="user"></label><!-- 快速鍵到指定id 僅ie支援 --></table><input type="hidden" name="xxx" value="ssss"></form></span>



10、注釋<!-- --> 特殊字元特殊字元:
        一些特殊符號,比如< > & 等,在代碼中會被瀏覽器識別並解釋
        所以用一些特殊的方式來表示

注釋用<!-- 注釋內容--> 

體育生學編程——html學習

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.