- W3.CSS 教程
- W3.CSS - 主頁
- W3.CSS - 概述
- W3.CSS - 環境設定
- W3.CSS - 容器
- W3.CSS - 程式碼著色
- W3.CSS - 卡片
- W3.CSS - 響應式設計
- W3.CSS - 網格
- W3.CSS - 表單
- W3.CSS - 按鈕
- W3.CSS - 工具提示
- W3.CSS - 模態對話方塊
- W3.CSS - 表格
- W3.CSS - 列表
- W3.CSS - 圖片
- W3.CSS - 圖示
- W3.CSS - 顏色
- W3.CSS - 導航
- W3.CSS - 實用程式
- W3.CSS 實用資源
- W3.CSS - 快速指南
- W3.CSS - 實用資源
- W3.CSS - 討論
W3.CSS - 圖示
W3.CSS 支援以下流行的圖示庫 -
Font Awesome 圖示
Google Material 圖示
Bootstrap 圖示
用法
要使用圖示,請將圖示的名稱放入 HTML <i> 元素的 class 中。要控制圖示的大小,可以使用以下 class -
| 序列號 | 類名和描述 |
|---|---|
| 1 | w3-tiny 繪製一個非常小的圖示。 |
| 2 | w3-small 繪製一個小圖示。 |
| 3 | w3-large 繪製一個大圖示。 |
| 4 | w3-xlarge 繪製一個特大圖示。 |
| 5 | w3-xxlarge 繪製一個特大號圖示。 |
| 6 | w3-xxxlarge 繪製一個極大號圖示。 |
示例
w3css_icons.htm
<html>
<head>
<title>The W3.CSS Icons</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://w3schools.tw/lib/w3.css">
<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel = "stylesheet" href = "https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel = "stylesheet" href = "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body class = "w3-container">
<h2>Icons Demo</h2>
<hr/>
<h3>Font Awesome Icon Demo</h3>
<i class = "fa fa-cloud"></i>
<i class = "fa fa-cloud w3-large"></i>
<i class = "fa fa-cloud w3-xlarge"></i>
<i class = "fa fa-cloud w3-xxlarge"></i>
<i class = "fa fa-cloud w3-xxxlarge"></i>
<i class = "fa fa-cloud w3-text-teal" style = "font-size:64px"></i>
<h3>Google Material Design Icon Demo</h3>
<i class = "material-icons w3-large">cloud</i>
<i class = "material-icons">cloud</i>
<i class = "material-icons w3-xlarge">cloud</i>
<i class = "material-icons w3-xxlarge">cloud</i>
<i class = "material-icons w3-xxxlarge">cloud</i>
<i class = "material-icons w3-text-teal" style = "font-size:64px">cloud</i>
<h3>Bootstrap Icon Demo</h3>
<i class = "glyphicon glyphicon-cloud"></i>
<i class = "gclass = "glyphicon glyphicon-cloud w3-large"></i>
<i class = "glyphicon glyphicon-cloud w3-xlarge"></i>
<i class = "glyphicon glyphicon-cloud w3-xxlarge"></i>
<i class = "glyphicon glyphicon-cloud w3-xxxlarge"></i>
<i class = "glyphicon glyphicon-cloud w3-text-teal" style = "font-size:64px"></i>
</body>
</html>
結果
驗證結果。
廣告