gpt4 book ai didi

html - 如何将图像并排放置

转载 作者:行者123 更新时间:2023-11-28 00:55:35 25 4
gpt4 key购买 nike

.boxGallery {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
margin-left: auto;
margin-right: auto;
width: 80%;
}

.gallery {
min-width: 320px;
width: 50%;
margin: 12px;
float: left;
}

.gallery img {
width: 100%;
height: auto;
padding: 5px;
border-radius: 12px;
}

.desc {
padding: 15px;
text-align: center;
}
<div class="boxGallery">
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>

<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
</div>

<div class="desc">
<p>Auvergne, Frankrijk 2018</p>
</div>

<div class="boxGallery">
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>

<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
</div>

我正在尝试制作一个照片库。问题是我无法让图像彼此相邻。所以我想要的是:我想要在照片的每个部分上方都有一个标题,该部分必须居中并且多个图像应该能够根据页面的大小并排放置。最后一件事是我无法开始工作(截图)。我真的不知道如何解决这个问题。有人有什么想法吗?

SCREENSHOT

最佳答案

如果您具有 Bootstrap 的基本知识。您可以使用以下示例制作照片库。 https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_img_thumbnail2&stacked=h

另一个例子

<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
<div class="row">
<div class="col-md-4">
<h2>Rounded Corners</h2>
<p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">
</div>
<div class="col-md-4">
<h2>Rounded Corners</h2>
<p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">
</div>
<div class="col-md-4">
<h2>Rounded Corners</h2>
<p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">
</div>
<div class="col-md-4">
<h2>Rounded Corners</h2>
<p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">
</div>
<div class="col-md-4">
<h2>Rounded Corners</h2>
<p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">
</div>
</div>
</div>

</body>
</html>

关于html - 如何将图像并排放置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52956785/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com