如何用4张图片制作卡产品的幻灯片显示?
我的卡产品具有1个主图片,并在主图下面有3张(小)图片,还带有一些带有按钮的额外文本区域。 我的计划是与这些图片一起幻灯片显示,我需要一些幻灯片节目的导航。 如何用4张图片制作卡产品的幻灯片表演?
*,
*:before,
*:after{
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
}
a, p, h1, h2, h3, h4, h5, h6{
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: inherit;
text-decoration: none;
color: inherit;
}
html, body{
background: linear-gradient(to right, #accbee 0%, #e7f0fd 50%);
height: 100%;
color: #000;
background-color: #E5E5E5;
font-size: 14px;
font-family: "Maven+Pro", sans-serif;
line-height: 1;
}
input, textarea{
outline: none;
}
.container {
max-width: 1380px;
margin: 0 auto;
padding: 0 1rem;
}
.header{
padding: 1.56rem 0;
}
.header__container{
display: flex;
justify-content: space-between;
align-items: center;
}
.header__link{
font-size: 1.5rem;
font-weight: 700;
color: #0046FF;
}
.header__button {
flex: 0 0 16rem;
display: flex;
justify-content: flex-end;
align-items: center;
}
.icon-menu {
position: relative;
flex: 0 0 1.9rem;
height: 1.12rem;
display: flex;
flex-direction: column;
justify-content: space-between;
margin: 0px 0px 0px 20px;
}
.icon-menu::before,
.icon-menu::after {
content:"";
height: 2px;
background-color: #000;
}
.icon-menu span {
height: 2px;
background-color: #000;
}
.header__login{
background-color: #0046FF;
color: #fff;
line-height: 1.9rem;
padding: 0 1.9rem;
border-radius: 10px;
text-transform: uppercase;
}
.search__container{
display: flex;
flex-direction: column;
justify-content: center;
min-height: 18vh;
margin-bottom: -36px;
}
.search__row{
display: flex;
justify-content: space-between;
margin: 0 0 2.5rem 0;
}
.search__row img:last-child{
width: 40%;
}
.search__bar{
margin: 0 0 2.5rem 0;
}
.search__input{
width: 100%;
border: 2px solid #80A7E0;
background: #ffffff;
border-radius: 0.9rem;
padding: 0.6rem 0.9rem;
}
.search__cards-header{
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 2.5rem 0;
}
.search__cards-title{
font-size: 2.1rem;
font-weight: 700;
}
.search__cards-button{
background-color: #0046FF;
color: #fff;
line-height: 2.5rem;
height: 2.5rem;
padding: 0 1.8rem;
border-radius: 10px;
text-transform: uppercase;
}
.card__item-img img {
border-radius: 10px;
display: block;
min-width: 800px;
max-height: 600px;
object-fit:contain;
overflow: hidden;
}
footer {
max-width: 1348px;
height: 12.5rem;
background-color: #fff;
padding: 4.3rem 0;
border-radius: 15px;
}
.row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.footer__col {
width: 25%;
padding: 3rem 1.5rem 0 3.4rem;
}
.footer__links img {
float:right;
width:30px;
text-align:center;
}
.footer__col ul li:not(:last-child) {
margin-bottom: 1.9rem;
}
.footer__col ul li a {
font-size: 1rem;
text-transform: capitalize;
font-weight: 500;
display: block;
color: rgb(128, 127, 128);
transition: all 0.5s ease;
}
.footer__col ul li a:hover {
color: #0046FF;
transform: scale(1.1);
}
.footer__col a img {
width: 30px;
height: 30px;
margin: 0 2rem 0 0;
transition: all 0.5s ease;
}
.footer__col a img:hover {
transform: scale(1.5);
transition: all 0.5s ease;
}
.card{
margin: 0 15px;
display: flex;
height: 500px;
max-width: 1380px;
margin: 0 auto;
margin-bottom: 55px;
justify-content: center;
align-items: center;
/* border: solid 1px red; */
border-radius: 15px;
overflow: hidden;
}
.card__item-img img{
background-color: #fff;
border-radius: 25px;
object-fit: fill;
}
.images {
display: flex;
justify-content: space-between;
align-items: center;
}
.img_small_lft {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left:290px;
border-radius: 15px;
}
.img_small_mid {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left: 450px;
border-radius: 15px;
}
.img_small_rht {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left: 610px;
border-radius: 15px;
}
.card__item-container {
display: flex;
height: 100%;
max-width: inherit;
flex-direction: column;
align-items: center;
justify-content:space-evenly;
/* background-color: #fff; */
}
.card__item-title {
font-size: 3rem;
font-weight: bold;
font-family:'Maven Pro', serif;
}
.card__item-text{
margin: 0 20px;
max-width: 65%;
font-size: 1.1rem;
text-align: justify;
letter-spacing: 2px;
line-height: 25px;
}
.button-64 {
align-items: center;
background-image: linear-gradient(144deg,#AF40FF, #5B42F3 50%,#00DDEB);
border: 0;
border-radius: 8px;
box-sizing: border-box;
color: #FFFFFF;
display: flex;
font-family: Phantomsans, sans-serif;
font-size: 20px;
font-weight: 700;
justify-content: center;
line-height: 1em;
max-width: 100%;
min-width: 140px;
padding: 3px;
text-decoration: none;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
white-space: nowrap;
cursor: pointer;
}
.button-64:active,
.button-64:hover {
outline: 0;
}
.button-64 span {
background-color: rgb(23, 215, 80);
padding: 16px 44px;
border-radius: 6px;
width: 100%;
height: 100%;
transition: 300ms;
}
.button-64:hover span {
background: none;
}
@media (min-width: 768px) {
.button-64 {
font-size: 24px;
min-width: 196px;
}
}
<body>
<!-- Header -->
<header class="header container">
<div class="header__container container">
<a class="header__link" href="#">AIRSHOP</a>
<div class="header__button">
<a class="header__login" href="#">Log in</a>
<a href="#menu" type="button" class="menu__icon icon-menu"><span></span></a>
</div>
</div>
</header>
<!-- Main -->
<div class="search container">
<div class="search__container container">
<div class="search__bar">
<input class="search__input" type="text" placeholder="Search..">
</div>
<div class="search__cards">
<div class="search__cards-header">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card container">
<div class="card_image-container">
<div class="card__item-img"><img src="https://images.unsplash.com/photo-1619659085779-29fcc0e41110?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTd8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60g" alt="img"></div>
</div>
<div class="card__item-container">
<h2 class="card__item-title">Joystick</h2>
<p class="card__item-text">A joystick, sometimes called a flight stick, is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. A joystick, also known as the control column, is the principal control device in the cockpit of many civilian and military aircraft, either as a centre stick or side-stick. It often has supplementary switches to control various aspects of the aircraft's flight. </p>
<button class="button-64" role="button"><span class="text">BUY NOW</span></button>
<div class="images">
<img class="img_small_lft" src="https://images.unsplash.com/photo-1619651565830-892ccdb2bd51?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTl8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
<img class="img_small_rht" src="https://images.unsplash.com/photo-1586063029643-fd87377743ef?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTh8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
<img class="img_small_mid" src="https://images.unsplash.com/photo-1597464524506-cb28023a9adf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTN8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer container">
<div class="row">
<div class="footer__links footer__col">
<ul class="footer__links-list">
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer__links footer__col">
<ul class="footer__links-list">
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact </a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer__links footer__col">
<div class="footer__social-links">
<a href=""><img src="Pinterest" alt="Pinterest" class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest"class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest" class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest" class="footer__social-link"></a>
</div>
</div>
</div>
</footer>
</body>
</html>
I have card product with 1 main picture and 3 additional (small) pictures beneath the main one and also have some additional text area with a button.
My plan is to have slide show with those pictures and I need some navigation for that slide show.
How to make a slide show for card product with 4 pictures?
*,
*:before,
*:after{
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
}
a, p, h1, h2, h3, h4, h5, h6{
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: inherit;
text-decoration: none;
color: inherit;
}
html, body{
background: linear-gradient(to right, #accbee 0%, #e7f0fd 50%);
height: 100%;
color: #000;
background-color: #E5E5E5;
font-size: 14px;
font-family: "Maven+Pro", sans-serif;
line-height: 1;
}
input, textarea{
outline: none;
}
.container {
max-width: 1380px;
margin: 0 auto;
padding: 0 1rem;
}
.header{
padding: 1.56rem 0;
}
.header__container{
display: flex;
justify-content: space-between;
align-items: center;
}
.header__link{
font-size: 1.5rem;
font-weight: 700;
color: #0046FF;
}
.header__button {
flex: 0 0 16rem;
display: flex;
justify-content: flex-end;
align-items: center;
}
.icon-menu {
position: relative;
flex: 0 0 1.9rem;
height: 1.12rem;
display: flex;
flex-direction: column;
justify-content: space-between;
margin: 0px 0px 0px 20px;
}
.icon-menu::before,
.icon-menu::after {
content:"";
height: 2px;
background-color: #000;
}
.icon-menu span {
height: 2px;
background-color: #000;
}
.header__login{
background-color: #0046FF;
color: #fff;
line-height: 1.9rem;
padding: 0 1.9rem;
border-radius: 10px;
text-transform: uppercase;
}
.search__container{
display: flex;
flex-direction: column;
justify-content: center;
min-height: 18vh;
margin-bottom: -36px;
}
.search__row{
display: flex;
justify-content: space-between;
margin: 0 0 2.5rem 0;
}
.search__row img:last-child{
width: 40%;
}
.search__bar{
margin: 0 0 2.5rem 0;
}
.search__input{
width: 100%;
border: 2px solid #80A7E0;
background: #ffffff;
border-radius: 0.9rem;
padding: 0.6rem 0.9rem;
}
.search__cards-header{
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 2.5rem 0;
}
.search__cards-title{
font-size: 2.1rem;
font-weight: 700;
}
.search__cards-button{
background-color: #0046FF;
color: #fff;
line-height: 2.5rem;
height: 2.5rem;
padding: 0 1.8rem;
border-radius: 10px;
text-transform: uppercase;
}
.card__item-img img {
border-radius: 10px;
display: block;
min-width: 800px;
max-height: 600px;
object-fit:contain;
overflow: hidden;
}
footer {
max-width: 1348px;
height: 12.5rem;
background-color: #fff;
padding: 4.3rem 0;
border-radius: 15px;
}
.row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.footer__col {
width: 25%;
padding: 3rem 1.5rem 0 3.4rem;
}
.footer__links img {
float:right;
width:30px;
text-align:center;
}
.footer__col ul li:not(:last-child) {
margin-bottom: 1.9rem;
}
.footer__col ul li a {
font-size: 1rem;
text-transform: capitalize;
font-weight: 500;
display: block;
color: rgb(128, 127, 128);
transition: all 0.5s ease;
}
.footer__col ul li a:hover {
color: #0046FF;
transform: scale(1.1);
}
.footer__col a img {
width: 30px;
height: 30px;
margin: 0 2rem 0 0;
transition: all 0.5s ease;
}
.footer__col a img:hover {
transform: scale(1.5);
transition: all 0.5s ease;
}
.card{
margin: 0 15px;
display: flex;
height: 500px;
max-width: 1380px;
margin: 0 auto;
margin-bottom: 55px;
justify-content: center;
align-items: center;
/* border: solid 1px red; */
border-radius: 15px;
overflow: hidden;
}
.card__item-img img{
background-color: #fff;
border-radius: 25px;
object-fit: fill;
}
.images {
display: flex;
justify-content: space-between;
align-items: center;
}
.img_small_lft {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left:290px;
border-radius: 15px;
}
.img_small_mid {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left: 450px;
border-radius: 15px;
}
.img_small_rht {
max-width: 150px;
max-height: 150px;
position: absolute;
bottom:-60px;
left: 610px;
border-radius: 15px;
}
.card__item-container {
display: flex;
height: 100%;
max-width: inherit;
flex-direction: column;
align-items: center;
justify-content:space-evenly;
/* background-color: #fff; */
}
.card__item-title {
font-size: 3rem;
font-weight: bold;
font-family:'Maven Pro', serif;
}
.card__item-text{
margin: 0 20px;
max-width: 65%;
font-size: 1.1rem;
text-align: justify;
letter-spacing: 2px;
line-height: 25px;
}
.button-64 {
align-items: center;
background-image: linear-gradient(144deg,#AF40FF, #5B42F3 50%,#00DDEB);
border: 0;
border-radius: 8px;
box-sizing: border-box;
color: #FFFFFF;
display: flex;
font-family: Phantomsans, sans-serif;
font-size: 20px;
font-weight: 700;
justify-content: center;
line-height: 1em;
max-width: 100%;
min-width: 140px;
padding: 3px;
text-decoration: none;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
white-space: nowrap;
cursor: pointer;
}
.button-64:active,
.button-64:hover {
outline: 0;
}
.button-64 span {
background-color: rgb(23, 215, 80);
padding: 16px 44px;
border-radius: 6px;
width: 100%;
height: 100%;
transition: 300ms;
}
.button-64:hover span {
background: none;
}
@media (min-width: 768px) {
.button-64 {
font-size: 24px;
min-width: 196px;
}
}
<body>
<!-- Header -->
<header class="header container">
<div class="header__container container">
<a class="header__link" href="#">AIRSHOP</a>
<div class="header__button">
<a class="header__login" href="#">Log in</a>
<a href="#menu" type="button" class="menu__icon icon-menu"><span></span></a>
</div>
</div>
</header>
<!-- Main -->
<div class="search container">
<div class="search__container container">
<div class="search__bar">
<input class="search__input" type="text" placeholder="Search..">
</div>
<div class="search__cards">
<div class="search__cards-header">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card container">
<div class="card_image-container">
<div class="card__item-img"><img src="https://images.unsplash.com/photo-1619659085779-29fcc0e41110?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTd8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60g" alt="img"></div>
</div>
<div class="card__item-container">
<h2 class="card__item-title">Joystick</h2>
<p class="card__item-text">A joystick, sometimes called a flight stick, is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. A joystick, also known as the control column, is the principal control device in the cockpit of many civilian and military aircraft, either as a centre stick or side-stick. It often has supplementary switches to control various aspects of the aircraft's flight. </p>
<button class="button-64" role="button"><span class="text">BUY NOW</span></button>
<div class="images">
<img class="img_small_lft" src="https://images.unsplash.com/photo-1619651565830-892ccdb2bd51?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTl8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
<img class="img_small_rht" src="https://images.unsplash.com/photo-1586063029643-fd87377743ef?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTh8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
<img class="img_small_mid" src="https://images.unsplash.com/photo-1597464524506-cb28023a9adf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTN8fGFpcnBsYW5lc3xlbnwwfDB8MHx8&auto=format&fit=crop&w=600&q=60" alt="img" srcset="">
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer container">
<div class="row">
<div class="footer__links footer__col">
<ul class="footer__links-list">
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer__links footer__col">
<ul class="footer__links-list">
<li class="footer__links-items"><a href="#">Contact</a></li>
<li class="footer__links-items"><a href="#">Contact </a></li>
<li class="footer__links-items"><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer__links footer__col">
<div class="footer__social-links">
<a href=""><img src="Pinterest" alt="Pinterest" class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest"class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest" class="footer__social-link"></a>
<a href=""><img src="" alt="Pinterest" class="footer__social-link"></a>
</div>
</div>
</div>
</footer>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在html/css和一些JS中使用这样的缩略图滑块,但您可以使用swiper js
您可以使用 swiper slider,使用 thumbs画廊环路并将缩略图移动到CSS中。
slider with thumbnail like this in HTML/CSS and some Js but you can use swiper js
you can use Swiper slider , use Thumbs gallery loop and move thumbnail image up in css .