源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> div.polaroid { width: 250px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); text-align: center; } div.container { padding: 10px; } </style> </head> <body> <h2> 卡片</h2> <p>box-shadow屬性可以用來創建紙質樣式卡片:</p> <div class="polaroid"> <img src="/images/logo.png" alt="Norway" style="width:100%"> <div class="container"> <p>Hardanger, Norway</p> </div> </div> </body> </html>
運行結果