使图像边框看起来像包含其他图像的文件夹
make an image border look like a folder that includes other images
你好,我正在尝试制作一个家庭假期图片网站,它有一个包含文件夹的页面,其中包含每天的一张图片,我可以单击每张图片并转到包含所有图片的不同页面那天的照片。
一切看起来都不错,但我想为文件夹页面上的每个图像添加一个边框,我希望边框看起来像一个文件夹,右上角应该比左边高一点等。
我尝试使用一些工具提示 css 样式,它们看起来像一个箭头,但没有用。
希望这个问题足够清楚,这是我能描述的最好的问题。
<div class="container">
<div class="row">
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
</div>
</div>
和css
.img {
border: black 5px solid;
position: relative;
margin: 5px;
}
.img:hover {
cursor: pointer;
opacity: .8;
box-shadow: 0 0 5px 3px rgba(0, 140, 186, 0.5);
}
.img::before {
content: " ";
position: absolute;
bottom: 100%;
left: 0;
margin-right: -5px;
border-width: 10px;
border-style: solid;
border-color: black transparent black transparent;
}
感谢您的好问题。
请尝试以下代码。我通过一些 CSS 代码解决了这个问题。希望是你找到的作品
.container {
display: flex;
}
.folder {
width: 150px;
height: 105px;
margin: 0 auto;
margin-top: 50px;
position: relative;
background-color: #708090;
border-radius: 0 6px 6px 6px;
box-shadow: 4px 4px 7px rgba(0, 0, 0, 0.59);
}
.folder:before {
content: '';
width: 50%;
height: 12px;
border-radius: 0 20px 0 0;
background-color: #708090;
position: absolute;
top: -12px;
left: 0px;
}
<!DOCTYPE html>
<html>
<head>
<title>Folder via HTML & CSS By Monzur Alam</title>
</head>
<body>
<div class="container">
<div class="folder">
<a href=""><img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" /></a>
</div>
<div class="folder">
<img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" />
</div>
<div class="folder">
<img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" />
</div>
</div>
</body>
</html>
你好,我正在尝试制作一个家庭假期图片网站,它有一个包含文件夹的页面,其中包含每天的一张图片,我可以单击每张图片并转到包含所有图片的不同页面那天的照片。
一切看起来都不错,但我想为文件夹页面上的每个图像添加一个边框,我希望边框看起来像一个文件夹,右上角应该比左边高一点等。
我尝试使用一些工具提示 css 样式,它们看起来像一个箭头,但没有用。
希望这个问题足够清楚,这是我能描述的最好的问题。
<div class="container">
<div class="row">
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
<div class="col-lg-3">
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
<a href="images.html"><img src="image1200.jpg" class="img-fluid img" alt=""></a>
</div>
</div>
</div>
和css
.img {
border: black 5px solid;
position: relative;
margin: 5px;
}
.img:hover {
cursor: pointer;
opacity: .8;
box-shadow: 0 0 5px 3px rgba(0, 140, 186, 0.5);
}
.img::before {
content: " ";
position: absolute;
bottom: 100%;
left: 0;
margin-right: -5px;
border-width: 10px;
border-style: solid;
border-color: black transparent black transparent;
}
感谢您的好问题。 请尝试以下代码。我通过一些 CSS 代码解决了这个问题。希望是你找到的作品
.container {
display: flex;
}
.folder {
width: 150px;
height: 105px;
margin: 0 auto;
margin-top: 50px;
position: relative;
background-color: #708090;
border-radius: 0 6px 6px 6px;
box-shadow: 4px 4px 7px rgba(0, 0, 0, 0.59);
}
.folder:before {
content: '';
width: 50%;
height: 12px;
border-radius: 0 20px 0 0;
background-color: #708090;
position: absolute;
top: -12px;
left: 0px;
}
<!DOCTYPE html>
<html>
<head>
<title>Folder via HTML & CSS By Monzur Alam</title>
</head>
<body>
<div class="container">
<div class="folder">
<a href=""><img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" /></a>
</div>
<div class="folder">
<img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" />
</div>
<div class="folder">
<img src="https://cdn.sstatic.net/Img/teams/teams-illo-free-sidebar-promo.svg?v=47faa659a05e" />
</div>
</div>
</body>
</html>