小強的HTML5移動開發之路(1)——HTML介紹

來源:互聯網
上載者:User

HTML是HyperText Markup Language(超文字標記語言 (HTML))的縮寫,是構成所有所有網頁基本結構的文本及標籤組合。

一、目前市場上流行的瀏覽器

IE/Chrome/firefox/opera

其中Chrome/firefox/opera以及IE 9/10都能很好的相容html5

二、HTML標籤

html標籤都以“<"括弧開始,並以">"括弧結束

如<a href="http://blog.csdn.net/dawanganban">

常用的屬性有:id、class、style、title

id:該屬性為標籤所指對象提供一個名字

class:該屬性為對象提供一個類名

style:該屬性為對象應用一個對應的css樣式

title:為對象賦予一個標題,大多數瀏覽器在滑鼠經過時會提示。

<html><head><title>first html</title><!--refresh:重新整理--><meta http-equiv="refresh" content="1;url=http://blog.csdn.net/dawanganban'"><!-- 表示每隔1秒向url地址重新整理 --><meta http-equiv="content-type" content="text/html;charset=utf-8"><!--引入一個樣式檔案--><link rel="stylesheet" type="text/css" href="style.css"></head><body>hello word<body></html> 

三、重要標記

(1)連結

<a href="地址”  target="開啟的視窗"  title="提示資訊"></a>

target="_black":在新的視窗中開啟連結

target="_selt":預設值,在當前視窗中開啟

(2)圖片連結

<a href="地址" border="0"><img src="test.jpg"></a>

border屬性值:為了去掉預設邊框。

(3)發郵件

<a href="mailto:739299362@qq.com?subject=hello">發郵件</a>

 (4)錨點(在同一頁面進行跳轉)

<a name="top">跳到這裡</a>

<a href="#top">跳到top</a>

  (5)表格

<table border="1" width="60%" cellpadding="10" cellspacing="0">

<tr><td>表格一</td><td>表格二</td></tr>
<tr><td>BIAOGE</td><td>BIAOGE</td></tr>

</table>

表格的對齊

align屬性:水平對齊。  值:left(預設):偏左/rignt/center
valign屬性:垂直對齊。 值:top/bottom(預設)/middle
     不規則表格
colspan屬性:合并水平單元格(合并列)
rowspan屬性:合并豎直單元格(合并行)
      表格可以嵌套
      表格的完整定義
<table>
<caption>主題</caption>   只能是0個或者1個
<thead>表頭</thead>       只能是0個或者1個
<tfoot>表腳</tfoot>
<tbody>表體</tbody>
</table>

(6)表單

 <form action="伺服器端的一個程式" method="get/post">
<!--input標記-->
<!--非input標記-->
     </form>
      1)input標記:
文本輸入框:<input type="text" name="username" value="預設值"/><!--必須加name-->
提交按鈕: <input type="submit" value="確認"/>
密碼輸入框:<input type="password" name="pwd"/> <!--必須加name-->
單選:<input type="radio" name="gender" value="m"/><!--必須加name和value-->
   <!--同一組name必須相同-->
多選:<input type="checkbox" name="interest" value="fishing"/>
重設:<input type="reset" value="取消"/>
普通按鈕:<input type="button" value="點我吧"/>
上傳檔案:<input type="file" name="file1"/>
隱藏欄位:<input type="hidden" name="userId" value="123">
     2)非input標記
下拉式清單:
<select name="city" multiple="multiple">
<option value="bj">北京</option>
<option value="wh">武漢</option>
<option value="nj">南京</option>
</select>
<!--加上mutiple屬性就成為多選了-->
多行文本輸入框:
<textarea name="desc" cols="" rows=""></textarea>

    (7)列表
無序列表:
<ul>
<li>item1</li>
<li>item2</li>
</ul>
有序列表:
<ol>
<li>item1</li>
<li>item2</li>
<ol>
    (8)架構
<frameset>
作用是將一個大的視窗劃分成許多子視窗
<frameset rows="200,300,*">  <!--劃分為三個視窗-->
<frameset rows="20%,*">  <!--按照百分比劃分-->
<frame src="top.html"/>
<frameset cols="30%,*"/>
<frame src="left.html"/>
<frame src="right.html"/>
</frameset>
</frameset>
<iframe>
作用是在當前視窗中嵌入一個子視窗
<iframe src="some.html" width="" height="">

</iframe>


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.