HTML樣式插入、連結、表單標籤

生風發表於2020-10-18

HTML樣式

1.三種樣式插入方法

外部樣式表

<link rel = "stylesheet" type = "text/css" href = "***.css">

內部樣式表

<style type = "text/css">
    body {back-ground:red}
    p {margin-left:20px}
</style>

內聯樣式表

<p style = "color:red>

HTML 連結

1.連結資料

文字連結

<a href = "http://www.baidu.com">點選我</a>

圖片連結

<a href = "http://www.baidu.com">
       <img src = "**.png">
</a>

2.屬性:

href屬性:指向另一個文件的連結
name屬性:建立文件內的連結

<a name = "tips">hello</a>

<a href = "#tips">跳轉到hello</a>

3.img標籤屬性

alt:替換文字屬性
width:寬 height:高

HTML表單常用標籤

<input type = "text">
<input type = "password">
<input type = "button" value = "按鈕">
<input type = "submit" value = "確定">
<input type = "checkbox">

--- 二選一
<input type = "radio" name = "sex">
<input type = "radio" name = "sex">

--- 下拉選項
<select>
     <option>****</option>
     <option>****</option>
</select>

--- 文字域
<textarea cols = "30"  rows = "30">請在此填寫資訊</textarea>

相關文章