內(nèi)容概要
1.HTML樣式
2.HTML鏈接
3.HTML表格
1.HTML樣式
標(biāo)簽
<style>:樣式定義
<link>:資源引用
-
屬性
rel = "stylesheet": 外部樣式表
type = "text/css": 引入文檔的類型
margin-left: 邊距
三種樣式表插入方法
1.外部樣式表:
<link rel = "stylesheet" type = "text/css href = "mystyle.css"">2.內(nèi)部樣式表: <style type = "text/css"> body { background-color:red } p { margin-left:20px } </style> 3.內(nèi)聯(lián)樣式表: <p style = "color:red">
例如下圖代碼片段:
屏幕快照 2017-07-06 下午3.20.01.png
屏幕快照 2017-07-06 下午3.20.11.png
屏幕快照 2017-07-06 下午3.26.46.png
如圖的代碼片段中,index.html中引入外部文檔資源mystyle.css中符。詳細(xì)請(qǐng)看代碼片段淀散,有詳細(xì)注釋。
2.HTML鏈接
-
鏈接數(shù)據(jù):
1.文本鏈接
<a > click me </a>2.圖片鏈接 <a > <img src = "html.png" width = "100px" height = "100px alt = "html5logo""> </a>
-
屬性:
1.href屬性:指向另一個(gè)文檔的鏈接
<a alt = "html5logo"> click me</a>2. name屬性:創(chuàng)建文檔內(nèi)的鏈接 <a name = "tips"> hello </a> <a href = "#tips"> jump to hello </a> 這樣點(diǎn)擊鏈接后就會(huì)跳轉(zhuǎn)到hello的地方吧凉,大家可以試一下阀捅。
img標(biāo)簽屬性:
alt:替換文本屬性
width: 寬
height: 高
3.HTML表格
<table>定義表格
<caption>定義表格標(biāo)題
<th>定義表格的表頭
<tr>定義表格的行
<td>定義表格的單元
<thead>定義表格的頁(yè)眉
<tbody>定義表格的主題
<tfoot>定義表格的頁(yè)腳
<col>定義表格的列屬性
代碼片段:
<table border = "1">
<tr>
<th>我是表頭1</th>
<th>我是表頭2</th>
<th>我是表頭3</th>
</tr>
<tr>
<td>表格1</td>
<td>表格2</td>
<td>表格3</td>
</tr>
<tr>
<td>表格1</td>
<td>表格2</td>
<td>表格3</td>
</tr>
</table>
結(jié)果:
屏幕快照 2017-07-06 下午5.11.50.png
今天先學(xué)習(xí)到這里,明天繼續(xù)學(xué)習(xí)圆雁,謝謝!