방법 - 제품 카드
CSS로 제품 카드를 만드는 방법을 알아보세요.
테일러드 진
$19.99
청바지에 대한 몇 가지 텍스트. 슈퍼 슬림하고 편안한 브렉퍼스트 진. jeamsun 데님 브렉퍼스트 청바지를 만나보세요.
제품 카드를 만드는 방법
1단계) HTML 추가:
예시
<div class="card">
<img src="jeans3.jpg" alt="Denim Jeans"
style="width:100%">
<h1>Tailored Jeans</h1>
<p
class="price">$19.99</p>
<p>Some text about the jeans..</p>
<p><button>Add to Cart</button></p>
</div>
2단계) CSS 추가:
예시
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 300px;
margin: auto;
text-align: center;
font-family: arial;
}
.price
{
color: grey;
font-size: 22px;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color:
white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}