or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
md.nchuit.cc/html/
HTML 簡介
與基礎語法
目錄
呈現方式
記事本
Word
FB 社團 - 發文
網絡論壇 - 發帖
巴哈姆特哈啦區 - 發文
巴哈姆特攻略百科 - 發文/編輯
巴哈姆特我的小屋 - 創作
迷思
首先,HTML 不是程式語言,而是標記語言。
ProgarmCodeHTML
瀏覽器可以讀取HTML檔案,並將其彩現成視覺化網頁。
HTML描述了一個網站的結構語意隨著線索的呈現,使之成為一種標記語言而非程式語言。
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →HTML 元素
HTML 中,一個 HTML 元素是 HTML 檔案(或訊息)的一個基本組成單元。HTML 檔案採用採用樹狀結構安排 HTML 元素。
常見的 HTML 元素有標題、段落、連結、列表、嵌入媒體等等。
例子(標題)
段落 連結 紅色
乙動動手: 檢查方法1 - 選單>檢查
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →🕹快捷鍵: 在 Chrome 或 Edge 瀏覽器中按下 F12 或 Ctrl + Shift + I 可以在
Elements
頁面檢視所有 HTML 元素。動動手: 檢查方法2 - 選取工具
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →🕹快捷鍵: 在 Chrome 或 Edge 瀏覽器中按下 Ctrl + Shift + C 可以直接啟動選取模式。
HTML Tag
<tag>...</tag>
很多,特別又想用的要自己找,本次教學只介紹常用的
*.html
基礎框架你可能注意到了…
<head>
內的元素都不需要用</*>
關起來練習: 找出上面代碼整個區域是什麼
一般內文
我不是一般內文

段落
<p>
我是第一段
我是第二段
段內換行
<br>
*不用
</br>
段內
換行
首行縮排
style="text-indent:*"
如果沒有到第二行就看不出來(?)補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字補字
練習: 複製下面的文字,用HTML標記成下面的樣子
早上好中國,現在我有冰淇淋,我很喜歡冰淇淋。但是,速度與激情9比冰淇淋...↓
速度與激情9,我最喜歡。所以現在是音樂時間,準備,1、2、3...↲
兩個禮拜以後~速度與激情9~↓
兩個禮拜以↘後~速度與激情9~↓
兩個禮拜以後~~速度與激情9~↲
不要忘記,不要錯過。去電影院看速度與激情9,因為非常好,電影動作非常好。↓
差不多一樣,冰淇淋,再見。↲
置中 置右 置左
style="text-align:center/right/left"
置中文字
置右文字
置左文字
屬性 (Attribute)
<TAG AAA="aaa" BBB="bbb" ...>
標題
<h1><h2>...<h6>
預設只有到h6,想新增就自己來
標題四
標題五
標題六
練習: 試試將 任一標題 置中
置中標題四
粗體 斜體 底線 刪除線
<B>
<I>
<U>
<S>
粗體 斜體 底線
刪除線段內區塊
<span>
& 文字顏色style="color:*"
藍色 紅色
練習: 我喜歡吃
屎冰淇淋無序清單
<ul>
預設是實心圓點,其他符號可以在這找,有兩種方法:
type="circle/disc/square"
style="list-style-type:'*'"
可以直接把符號打在*的地方
有序清單
<ol>
type="1/a/A/i/I"
style="list-style-type:'*'"
超連結
<a>
超連結
插入圖片
<img>
*不用
</img>
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →練習: 圖片超連結
嵌入
<iframe>
mute=1
loop=1&playlist=影片ID
表格
<table>
表單
<form>
<div>
<div>
style="display:block"
<span>
style="display:inline"
補充
CSS
<style>
剛剛放在
<tag *>
開頭旁邊style="*"
可一次寫完,但要指定哪些<tag>
套用是門學問,像下面這樣。另外也可以存成
*.css
檔使用,<style>
就可以拔掉框架: Bootstrap
下面放
<head>
用按鈕來舉例,放
<body>
框架: Semantic UI
<head>
<body>
圖包
https://fontawesome.com/icons/google
JavaScript
<script>
這才叫程式(Program')語言,讓使用者可以跟網頁互動,對資料進行流程控制等操作。
詳細請見(下學期?): JavaScript 教學
可以直接在觸發動作時使用
也可以在網頁開啟時就跑起來
也可以存成
*.js
,<script>
就可以拔掉HTTP
HyperText Transfer Protocol(超文本傳輸協定),是全球資訊網絡數據通信的基礎。
HTTPS
HyperText Transfer Protocol Secure,是一種透過計算機網路進行安全通訊的傳輸協定。HTTPS經由實聯制進行通訊,但利用SSL/TLS來加密封包,更安全。
URL(網址)
Uniform Resource Locator(統一資源定位符),俗稱網頁位址,簡稱網址,是網際網路上標準的資源的位址(Address),如同在網路上的門牌。
統一資源定位符的完整格式如下:
其中[使用者@]、[:埠號]、[檔案路徑]、[?請求參數]、[#ID]都屬於選填項。
請求與回應
HTTP 的基本運作方式就像上圖一樣,我們開啟網頁、或在網頁上做特定的操作的時候,其實都是在向伺服器發送請求(
request
),而伺服器則會對應request
給予我們回應(response
)。回應(
response
)的主要內容就是 HTML。伺服器
「網路伺服器」(web server)可以指軟體、也可以指硬體、還可以指它們共同運作的狀態。
存放網路伺服器軟體(如 phpMyAdmin)、網站檔案(如
*.html
、*.css
、*.js
)的電腦。它會連上網際網路(Internet)並能和其他連上網的設備做物理數據交換。
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →全稱:「PHP:Hypertext Preprocessor」,即「PHP:超文字預處理器」,是一種開源的通用電腦手稿語言。PHP的應用範圍相當廣泛,尤其是在網頁程式的開發上並可嵌入HTML中使用。
需存成
*.php
,只能在伺服器上跑SQL
SQL(Structured Query Language:結構化查詢語言)是一種特定目的程式語言,用於管理關聯式資料庫管理系統(RDBMS),或在關係流資料管理系統(RDSMS)中進行流處理。MySQL?
SQL你的Google試算表
這投影片跟網頁就是用 MarkDown 寫的