QUICK REFERENCE
基本語法速查表
忘記語法時先查這裡;需要理解「為什麼」時再進完整章節。不要把速查表當成完整學習。
HTML
| 用途 | 語法 |
|---|---|
| 標題 / 段落 | <h1>...</h1>、<p>...</p> |
| 連結 | <a href="...">...</a> |
| 圖片 | <img src="..." alt="..."> |
| 清單 | <ul><li>...</li></ul> |
| 表單 | <form>、<label>、<input>、<button> |
| 語意區塊 | header nav main section article aside footer |
CSS
| 用途 | 語法 |
|---|---|
| Element / Class / ID | p {}、.card {}、#hero {} |
| 尺寸 | width、height、max-width |
| Box | margin、border、padding |
| 文字 | font-size、font-weight、line-height |
| Flex | display:flex、gap、justify-content、align-items |
| Grid | display:grid、grid-template-columns |
| Responsive | @media (...) |
JavaScript
| 用途 | 語法 |
|---|---|
| 變數 | const x = 1;、let y = 2; |
| 比較 | === !== < <= > >= |
| 邏輯 | && || ! |
| 條件 | if (...) {} else {} |
| 迴圈 | for (...)、while (...)、for...of |
| Function | function add(a,b){ return a+b; } |
| Array | []、push、map、filter、find |
| Object | { key: value }、obj.key |
| DOM | querySelector、textContent、classList |
| Event | addEventListener |
| Async | Promise、async、await、fetch |
| Error | try/catch、throw new Error() |
C++
| 用途 | 語法 |
|---|---|
| 型別 | int、double、char、bool、std::string |
| I/O | std::cin >> x;、std::cout << x; |
| 條件 | if (...) {} else {} |
| Loop | for、while |
| Function | int add(int a,int b) |
| Container | std::vector<int> |
| Reference | int& ref = x; |
| Pointer | int* ptr = &x;、*ptr |
Git
| 用途 | 指令 |
|---|---|
| 狀態 | git status |
| 差異 | git diff、git diff --staged |
| 暫存 | git add file |
| 提交 | git commit -m "message" |
| 歷史 | git log --oneline |
| 同步 | git fetch、git pull、git push |
PowerShell
| 用途 | 指令 |
|---|---|
| 目前路徑 | Get-Location |
| 切換資料夾 | Set-Location C:\Projects |
| 列檔案 | Get-ChildItem |
| 找 command | Get-Command git |
| process | Get-Process |
| 上一個 exe exit code | $LASTEXITCODE |
SQL
| 用途 | 語法 |
|---|---|
| 查詢 | SELECT ... FROM ... WHERE ...; |
| 新增 | INSERT INTO ... VALUES (...); |
| 修改 | UPDATE ... SET ... WHERE ...; |
| 刪除 | DELETE FROM ... WHERE ...; |
| 排序 | ORDER BY ... DESC |
| 聚合 | COUNT(*)、AVG(...) |
使用原則
如果你只是忘了拼法,用這頁查;如果你不知道它「何時執行、資料在哪、input/output 是什麼」,回完整課程。能抄出語法不等於看懂程式。