写一段html网页设计代码,是关于视频网站的视频摆放布局代码,每行大概四个视频陈列,每个视频下面都有两行文字的空间,可以填写视频标题,要求整体比较美观
时间: 2024-06-05 13:11:08 浏览: 132
好的,我已经记录下来了。针对您的请求,以下是HTML代码示例,实现视频网站的视频摆放布局:
```
<!DOCTYPE html>
<html>
<head>
<title>Video Website Layout</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f1f1f1;
margin: 0;
padding: 0;
}
h2 {
margin-top: 20px;
font-size: 18px;
font-weight: normal;
}
.videos {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 20px;
}
.video {
width: calc(25% - 20px);
margin-bottom: 40px;
background-color: #fff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
}
.video:hover {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.video img {
width: 100%;
height: 150px;
object-fit: cover;
transition: all 0.3s;
}
.video:hover img {
transform: scale(1.05);
}
.video-details {
padding: 10px;
}
.video-details h3 {
font-size: 16px;
margin: 0;
}
.video-details p {
font-size: 14px;
margin: 0;
}
@media screen and (max-width: 768px) {
.video {
width: calc(50% - 20px);
}
}
@media screen and (max-width: 480px) {
.video {
width: calc(100% - 20px);
}
}
</style>
</head>
<body>
<div class="videos">
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+1" alt="Video 1">
<div class="video-details">
<h3>Video Title 1</h3>
<p>Description of Video 1</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+2" alt="Video 2">
<div class="video-details">
<h3>Video Title 2</h3>
<p>Description of Video 2</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+3" alt="Video 3">
<div class="video-details">
<h3>Video Title 3</h3>
<p>Description of Video 3</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+4" alt="Video 4">
<div class="video-details">
<h3>Video Title 4</h3>
<p>Description of Video 4</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+5" alt="Video 5">
<div class="video-details">
<h3>Video Title 5</h3>
<p>Description of Video 5</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+6" alt="Video 6">
<div class="video-details">
<h3>Video Title 6</h3>
<p>Description of Video 6</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+7" alt="Video 7">
<div class="video-details">
<h3>Video Title 7</h3>
<p>Description of Video 7</p>
</div>
</div>
<div class="video">
<img src="https://via.placeholder.com/300x150.png?text=Video+8" alt="Video 8">
<div class="video-details">
<h3>Video Title 8</h3>
<p>Description of Video 8</p>
</div>
</div>
</div>
</body>
</html>
```
此代码将生成一个包含多行视频的布局,每行大概四个视频,每个视频下面有两行文字的空间可填写标题和描述。整体布局为响应式,适用于不同屏幕尺寸,并且具有美观的样式。
希望这些能够为您提供帮助!
阅读全文