- 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 提供了多種方式來使用 w3-image 作為主類,以美觀且有趣的方式顯示影像。
| 序號 | 類名及說明 |
|---|---|
| 1 | w3-image 代表基本樣式影像,無邊框。 |
| 2 | w3-circle 在一個圓內顯示影像 |
| 3 | w3-title 用於在影像上方放文字。 |
| 4 | w3-card 把一張圖片繪製成卡片。 |
示例
w3css_images.htm
<html>
<head>
<title>The W3.CSS Images</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel="stylesheet" href = "https://w3schools.tw/lib/w3.css">
</head>
<body class = "w3-container">
<h2>Images Demo</h2>
<hr/>
<h3>Simple Image</h3>
<div class = "w3-image">
<img src = "html5-mini-logo.jpg" alt = "html5">
</div>
<h3>Circled Image</h3>
<div class = "w3-image">
<img src = "html5-mini-logo.jpg" alt = "html5" class = "w3-circle">
</div>
<h3>Text over image</h3>
<div class = "w3-image"><img src = "html5-mini-logo.jpg" alt = "html5">
<div class = "w3-title w3-text-black">Learn HTML5</div>
</div>
<h3>Image as a card</h3>
<div class = "w3-image">
<img src = "html5-mini-logo.jpg" alt = "html5" class = "w3-card-4">
</div>
</body>
</html>
結果
驗證結果。
廣告