使用html+css绘制一个好看的信用卡
时间: 2024-04-02 21:35:53 浏览: 100
jQuery+HTML5仿信用卡电子签名特效.zip
好的,以下是一个简单的示例,仅供参考:
```html
<div class="card">
<div class="card-front">
<div class="card-logo">Visa</div>
<div class="card-chip"></div>
<div class="card-number">1234 5678 9012 3456</div>
<div class="card-info">
<div class="card-name">Your Name</div>
<div class="card-expiry">MM/YY</div>
</div>
</div>
<div class="card-back">
<div class="card-stripe"></div>
<div class="card-cvv">123</div>
<div class="card-signature"></div>
</div>
</div>
```
```css
.card {
width: 350px;
height: 220px;
perspective: 1000px;
}
.card-front, .card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.card-front {
background-color: #0070ba;
color: #fff;
transform: rotateY(0deg);
transition: transform 0.6s ease-in-out;
}
.card-back {
background-color: #fff;
color: #000;
transform: rotateY(180deg);
transition: transform 0.6s ease-in-out;
}
.card-logo {
font-size: 30px;
font-weight: bold;
margin: 20px;
}
.card-chip {
width: 50px;
height: 50px;
background-image: url('https://i.imgur.com/ArTQ3zG.png');
background-size: cover;
position: absolute;
top: 60px;
right: 20px;
}
.card-number {
font-size: 24px;
font-weight: bold;
margin: 80px 20px;
}
.card-info {
display: flex;
justify-content: space-between;
margin: 20px;
}
.card-name {
font-size: 18px;
font-weight: bold;
}
.card-expiry {
font-size: 18px;
}
.card-back {
transform: rotateY(180deg);
}
.card-stripe {
width: 100%;
height: 40px;
background-color: #000;
position: absolute;
top: 80px;
}
.card-cvv {
font-size: 24px;
font-weight: bold;
position: absolute;
top: 130px;
right: 20px;
}
.card-signature {
width: 120px;
height: 40px;
background-color: #fff;
border: 1px solid #000;
position: absolute;
bottom: 20px;
right: 20px;
}
```
这只是一个简单的示例,你可以根据需要进行调整和美化。
阅读全文