📕
HTML & CSS
  • 網頁設計 - HTML & CSS
  • 1 簡介
    • 1.1 講者簡介
    • 1.2 課程須知
    • 1.3 網站前端簡介
    • 1.4 開發工具簡介
    • 1.5 第一個網頁
  • 2 HTML
    • 2.1 html 文件基本結構
    • 2.2 宣告、標籤、屬性、元素
    • 2.3 保留文字格式
    • 2.4 表示程式的標籤
    • 2.5 註解
    • 2.6 網頁標題
    • 2.7 中介資料(Meta Data)
    • 2.8 縮寫
    • 2.9 斷行與水平分隔線
    • 2.10 段落
    • 2.11 內容標題
    • 2.12 判別區塊與行內
    • 2.13 列表
    • 2.14 清單
    • 2.15 連結
    • 2.16 圖片
    • 2.17 獨立內容
    • 2.18 表格
    • 2.19 嵌入外站
    • 2.20 span 和 div
    • 2.21 引用
    • 2.22 有結構的語意元素
    • 2.23 結構驗證
    • 2.24 HTML Entity(實體)
    • 2.25 影片
    • 2.26 音訊
    • 2.27 其它標籤
    • 2.28 表單
    • 2.29 HTML 所有標籤
  • 3 CSS
    • 3.1 套用 CSS
    • 3.2 註解
    • 3.3 Selectors - 屬性及值
    • 3.4 Selectors - 符號
    • 3.5 Selectors - class 和 id
    • 3.6 關於優先權
    • 3.7 排版 - 關於 display 屬性
    • 3.8 排版 - 區塊模型(Box Model)
    • 3.9 排版 - vertical-align 對齊
    • 3.10 練習 - 固定式版型
    • 3.11 關於 Pseudo Element
    • 3.12 關於 Pseudo Class
    • 3.13 文字樣式
    • 3.14 關於溢載
    • 3.15 連結樣式
    • 3.16 列表樣式
    • 3.17 表格樣式
    • 3.18 背景樣式
    • 3.19 排版 - 關於定位(position)
    • 3.20 排版 - 關於浮動(float)
    • 3.21 關於不透明度 opacity
    • 3.22 關於 visibility、pointer-events
    • 3.23 關於 outline
    • 3.24 表單樣式
    • 3.25 效果 - 游標
    • 3.26 效果 - 圓角
    • 3.27 效果 - 區塊陰影
    • 3.28 效果 - 文字陰影
    • 3.29 效果 - 轉換 transform
    • 3.30 Flexbox 排版 - Container
    • 3.31 Flexbox 排版 - Items
    • 3.32 Column 多欄排版模式
    • 3.33 其它補充
  • 4 練習
  • 5 作業:網頁切版
  • 6 參考資料
Powered by GitBook
On this page
  • 1 介面 - Alerts
  • 2 介面 - Button 按鈕
  • 3 介面 - Breadcrumb 麵包屑
  • 4 介面 - 直向圖文編排
  • 5 介面 - 文繞圖
  • 6 介面 - Pagination 分頁
  • 7 介面 - 用 CSS 做三角形
  • 8 介面 - 按鈕 tooltip
  • 9 介面 - Popover
  • 10 介面 - Input Group
  • 11 介面 - List Group 列表群組
  • 12 介面 - Progress 進度條
  • 13 介面 - 使用圖片客製化列表項目符號
  • 14 效果 - 影片第一屏滿版
  • 15 介面 - 雙態開關(checkbox)
  • 其它參考(需要 JS 程式)
  • 1 介面 - Modal 彈出視窗
  • 2 介面 - Tab 頁籤
  • 3 效果 - 使用 scrollTo() 函式,點擊按鈕,頁面滑到最上方

4 練習

Previous3.33 其它補充Next5 作業:網頁切版

Last updated 1 year ago

1 介面 - Alerts

檔名建議:alert.html

說明:

  • 藍色背景色 #cce5ff,邊框 1px 實線,邊框顏色 #b8daff。

  • 紅色背景色 #f8d7da,邊框 1px 實線,邊框顏色 #f5c6cb。

  • 內距(padding):上下 5px、左右 10px。

  • 圓角(border-radius):5px。

  • 藍色、紅色分別是一個 div 區塊即可。

結果示意圖:

提供 html:

<div class="alert">
  這是一般的文字訊息
</div>

<div class="alert -error">
  這是警告的文字訊息
</div>

參考作法:

2 介面 - Button 按鈕

檔名建議:button.html

說明:

  • 請用 button 標籤( type="button" )製作。

  • 文字大小 1rem、文字顏色 #007bff。邊框 1px 實線、邊框顏色 #007bff。

  • 按鈕圓角(border-radius) .25rem。

  • 按鈕內距(padding):.375rem .75rem 。

  • 滑鼠移過:文字顏色 #FFF。背景顏色 #007bff。

  • 滑鼠移過游標(cursor)變成: pointer。

結果示意:

參考作法:

3 介面 - Breadcrumb 麵包屑

檔名建議:breadcrumb.html

說明:

  • 最外層 div,裡面請用 ol 標籤製作。

  • 連結文字顏色 #007bff,滑鼠移過後變成 #0056b3。

  • 提示:斜線可用 ::before 來創造,顏色為 #aaa。

  • div 背景色為 #e9ecef,內距上下 5px、左右 10px。圓角 5px。

結果示意圖:

提供 html:

<div class="breadcrumb">
  <ol class="breadcrumb_list">
    <li><a href="#">首頁</a></li>
    <li><a href="#">分類頁</a></li>
    <li>商品頁</li>
  </ol>
</div>

參考作法:

4 介面 - 直向圖文編排

檔名建議:text_vertical.html

說明:

  • 圖片點擊開新分頁連至外站(任意網址皆可)。

  • 最外層用 article 標籤製作。寬度 300px。

  • 標題「農夫耕種的照片」用 h1 標籤製作。

  • 標題文字大小 1.2rem。

結果示意圖:

參考作法:

5 介面 - 文繞圖

檔名建議:text_float.html

說明:

  • 圖片點擊開新分頁連至外站(任意網址皆可)。

  • 最外層用 article 標籤製作。寬度 500px。

  • 標題「農夫耕種的照片」用 h1 標籤製作。

  • 標題文字大小 1.2rem。

  • 提示1:比照「直向圖文編排」,在結構上只加了一個「圖片簡述的文字」,其餘結構完全不會變,只調整樣式。

  • 提示2:連結區塊(灰框部份)設定成向左的浮動(float)。

結果示意圖:

參考作法:

6 介面 - Pagination 分頁

檔名建議:pagination.html

說明:

  • 列表使用 ul 標籤。

  • 框線顏色:#dee2e6。

  • 文字顏色:#dee2e6。

  • 滑鼠移過:背景色變成 #e9ecef;文字顏色變成 #0056b3。

  • 假設在第1頁:那 1 的樣式,預設要與滑鼠移過時的狀態一樣。

結果示意:

參考作法:

7 介面 - 用 CSS 做三角形

檔名建議:arrow_left.html

說明:

  • 假設是用 span 標籤做,可將四個邊框都設定成不同顏色,然後設定 10px 的實線(solid),display 設定成 inline-block,寬高都設定 0。即可清礎看到箭頭。

  • 顏色的完全透明,有一個關鍵字叫 transparent。

結果示意:

參考作法:

8 介面 - 按鈕 tooltip

檔名建議: button_tooltip.html

說明:

  • 設定 tooltip 不要斷行:white-space: nowrap。

提供 html 結構:

<button type="button" class="btn">這是按鈕文字這是按鈕文字<span class="tooltip">這是提示文字</span></button>

結果示意:

參考作法:

9 介面 - Popover

檔名建議:popover.html

說明:

  • popover 的背景色 #fed。邊框顏色 rgba(0,0,0,.3)。

  • 三角形旋轉 45deg:transform: rotate(45deg)。

  • 利用 ::before 來做三角形。

提供 html 結構:

<label class="popover_label">
  <input type="text" placeholder="輸入帳號">
  <span class="popover">
    僅能輸入英文字母、數字、底線(_)。
  </span>
</label>

結果示意:

參考作法:

10 介面 - Input Group

檔名建議:input_group.html

說明:

  • placeholder 文字設定為「輸入 Email」。

  • :focus 狀態時,背景色改成 hsla(200, 80%, 90%, 1)。

提供 html:

<div class="input_group">
  <label>@</label>
  <input type="text" placeholder="輸入 Email">
</div>

結果示意:

參考作法:

11 介面 - List Group 列表群組

檔名建議:list_group.html

說明:

  • 請用 ul 標籤來製作。

  • 邊框顏色:#ccc。

結果示意:

參考作法:

12 介面 - Progress 進度條

檔名建議: progress.html

說明:

  • 進度條的背景色為 #e9ecef。圓角(border-radius) 8px。

  • 有進度的顏色背景為 #007bff。

結果示意:

提供 html:

<div class="progress_bar">
  <span class="progress" style="width: 20%;"></span>
</div>
  
<div class="progress_bar">
  <span class="progress" style="width: 70%;"></span>
</div>

參考作法:

13 介面 - 使用圖片客製化列表項目符號

檔名建議:list_item_custom_img.html

說明:

使用 ul 標籤完成下圖排版,將項目符號客製化:

圖片路徑:

參考作法:

14 效果 - 影片第一屏滿版

檔名建議:video_first_screen.html

提供 html:

<div class="video_placeholder">
  <video id="the_video" muted loop autoplay playsinline>
    <source src="https://alldata.sgp1.digitaloceanspaces.com/videos/sample.mp4" type="video/mp4">
    Your browser does not support HTML5 video.
  </video>
</div>

<div class="other_contents">
  這是底部內容
</div>

呈現結果:

參考作法:

15 介面 - 雙態開關(checkbox)

直接提供參考作法:

其它參考(需要 JS 程式)

1 介面 - Modal 彈出視窗

或稱做 lightbox(燈箱),直接提供參考做法:

2 介面 - Tab 頁籤

直接提供參考做法:

3 效果 - 使用 scrollTo() 函式,點擊按鈕,頁面滑到最上方

參考作法:

圖片路徑:

圖片路徑:

https://picsum.photos/id/729/500/300
https://picsum.photos/id/729/500/300
https://alldata.sgp1.digitaloceanspaces.com/images/checkmark.png
直向圖文編排
橫向圖文編排
用 CSS 做向左的箭頭
進度條