상품카트 간단하게 꾸며보기 정보
상품카트 간단하게 꾸며보기관련링크
본문
구글링하다가 상품카트 디자인이 맘에 들어 수정해 보았습니다.
cat01.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shopping Cart Example01</title>
<link rel="stylesheet" href="css/cart01.css">
</head>
<body>
<div class="product">
<div class="imgbox">
<!-- 다운받은 이미지 파일명을 아래와 같이 바꾸셔야 합니다. -->
<img src="image.jpg" />
</div>
<div class="details">
<h2>Brand Name<br><span>Men's Designer T-Shirt</span></h2>
<div class="price">$55.99</div>
<label>Sizes</label>
<ul>
<li>XS</li>
<li>S</li>
<li>M</li>
<li>XL</li>
<li>XXL</li>
</ul>
<label>Colors</label>
<ul class="color">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<a href="#">Add to Cart</a>
</div>
</div>
</body>
</html>
cart01.css
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
body{
margin: 0;
padding: 0;
background: #ff4faf;
box-sizing: border-box;
font-family: 'Montserrat', sans-serif;
}
.product{
position: absolute;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
width: 240px;
height: 340px;
background: #fff;
box-shadow: 0 5px 15px rgba(0,0,0,0.25);
border-radius: 5px;
overflow: hidden;
/* transition: 0.5s; */
}
.product .imgbox {
/* position: absolute;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
width: 240px;
height: 340px; */
/* position: relative; */
height: 100%;
box-sizing: border-box;
border-radius: 5px;
overflow: hidden;
}
.product .imgbox img {
display: block;
width: 100%;
height: 80%;
/* overflow: hidden; */
margin: 0px auto;
}
.details {
position: absolute;
width: 100%;
/* bottom: 0; */
bottom: -140px;
background: #fff;
padding: 10px;
box-sizing: border-box;
box-shadow: 0 0 0 rgba(0,0,0,0);
transition: 0.5s;
}
.product:hover .details {
bottom: 0;
box-shadow: 0 -5px 15px rgba(0,0,0,0.25);
/* transition: .5s; */
}
.details h2{
margin: 0;
padding: 0;
font-size: 16px;
width: 100%;
}
.details h2 span{
font-size: 12px;
color: #ccc;
font-weight: normal;
}
.details .price {
position: absolute;
top: 10px;
right: 20px;
font-weight: bold;
color: #ff4faf;
font-size: 20px;
}
label {
display: block;
margin-top: 5px;
font-weight: bold;
font-size: 14px;
}
ul {
display: flex;
margin: 0;
padding: 0;
}
ul li{
list-style: none;
margin: 5px 5px 0;
font-size: 12px;
font-weight: normal;
color: #ccc;
}
ul li:first-child{
margin-left: 0;
}
ul.color li {
width: 16px;
height: 16px;
}
ul.color li:nth-child(1) {
background: #ff0;
}
ul.color li:nth-child(2) {
background: #f00;
}
ul.color li:nth-child(3) {
background: #f0f;
}
ul.color li:nth-child(4) {
background: #0ff;
}
ul.color li:nth-child(5) {
background: #00f;
/* margin-left: 5px; */
}
.details a {
display: block;
padding: 5px;
color: #fff;
margin: 15px 0 0;
background: #ff4faf;
text-align: center;
text-decoration: none;
transition: 0.3s;
cursor:pointer;
}
.details a:hover {
/* color: #fff; */
background: #ff209a;
}
그냥 참조만하시면 좋을듯 싶네요.
사용한 이미지는 무료이미지 사이트에서 그냥 받아서 파일명을 바꾸시면 됩니다.
이미지 다운링크는 걸어두었습니다.
1
댓글 0개