50 lines
1.5 KiB
HTML
50 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<style>
|
|
body {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 1000px;
|
|
}
|
|
.image-row {
|
|
display: flex;
|
|
}
|
|
.image-container {
|
|
text-align: center;
|
|
margin: 0 20px;
|
|
border: 2px solid #ccc; /* 添加方框样式 */
|
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
|
|
transition: transform 0.3s; /* 添加上浮的过渡效果 */
|
|
}
|
|
.image-container:hover {
|
|
transform: translateY(-10px); /* 上浮效果 */
|
|
}
|
|
img {
|
|
width: 300px;
|
|
height: 500px;
|
|
}
|
|
.image-caption {
|
|
font-size: 16px;
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
<title>带方框和上浮效果的图片</title>
|
|
</head>
|
|
<body>
|
|
<div class="image-row">
|
|
<div class="image-container">
|
|
<img src="img/about.png" alt="Image 1">
|
|
<p class="image-caption">这是图片1的说明文字。</p>
|
|
</div>
|
|
<div class="image-container">
|
|
<img src="img/about.png" alt="Image 2">
|
|
<p class="image-caption">这是图片2的说明文字。</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|