0
点赞
收藏
分享

微信扫一扫

案例 7:响应式卡片布局页面

曾宝月 05-26 06:00 阅读 15

<!DOCTYPE html>

<html lang="zh">

<head>

 <meta charset="UTF-8">

 <title>卡片展示</title>

 <style>

   body {

     font-family: sans-serif;

     margin: 0;

     padding: 20px;

     background: #eee;

   }

   .card-container {

     display: flex;

     flex-wrap: wrap;

     gap: 20px;

     justify-content: center;

   }

   .card {

     background: white;

     border-radius: 10px;

     width: 300px;

     padding: 20px;

     box-shadow: 0 0 10px #ccc;

   }

   .card img {

     width: 100%;

     border-radius: 6px;

   }

   .card h3 {

     margin: 10px 0;

   }

 </style>

</head>

<body>

 <h1>产品卡片</h1>

 <div class="card-container">

   <div class="card">

     <img src="https://via.placeholder.com/300x200" alt="产品1">

     <h3>产品一</h3>

     <p>这是第一款产品的介绍内容。</p>

   </div>

   <div class="card">

     <img src="https://via.placeholder.com/300x200" alt="产品2">

     <h3>产品二</h3>

     <p>这是第二款产品的介绍内容。</p>

   </div>

 </div>

</body>

</html>

举报

相关推荐

0 条评论