cheat/dev
← Todos os snippets

Card de produto

Card com imagem, título, preço e botão de compra.

Preview ao vivo

Código completo

<style>
*{box-sizing:border-box}
body{font-family:system-ui,sans-serif;margin:0;padding:20px;background:#0e1013;color:#e8eaec}
</style>
<style>
.card{max-width:240px;background:#16191d;border:1px solid #2a2e33;border-radius:14px;overflow:hidden;font-family:system-ui}
.card img{width:100%;height:140px;object-fit:cover;display:block;background:#2a2e33}
.card__body{padding:14px}
.card__titulo{font-weight:600;margin:0 0 4px;font-size:15px}
.card__preco{color:#1f9c7a;font-weight:700;margin:0 0 10px}
.card__btn{width:100%;padding:9px;border:none;border-radius:8px;background:#2f6fed;color:#fff;font-weight:600;cursor:pointer}
.card__btn:hover{background:#1d4ed8}
</style>
<div class="card">
  <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='140'%3E%3Crect width='240' height='140' fill='%232a2e33'/%3E%3C/svg%3E" alt="Produto">
  <div class="card__body">
    <p class="card__titulo">Teclado mecânico RGB</p>
    <p class="card__preco">R$ 349,90</p>
    <button class="card__btn">Adicionar ao carrinho</button>
  </div>
</div>