js+css图文卡片列表可切换上一条下一条视觉差异效果代码
代码语言:html
所属分类:幻灯片
代码描述:js+css图文卡片列表可切换上一条下一条视觉差异效果代码
代码标签: js css 图文 卡片 列表 切换 上一条 下一条 视觉差异
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* -----------------------
RESET Y ESTILOS BÁSICOS
------------------------ */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: sans-serif;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #f3ec78, #af4261);
}
/* -----------------------
SLIDER CONTAINER
------------------------ */
.slider-container {
position: relative;
width: 80%;
max-width: 1200px;
margin: auto;
overflow: hidden; /* Oculta el contenido que se sale de la caja */
}
/* -----------------------
SLIDER TRACK
------------------------ */
.slider-track {
display: flex;
transition: transform 0.4s ease;
}
/* -----------------------
CARD
------------------------ */
.card {
min-width: 300px;
margin: 0 1rem; /* espacio lateral entre tarjetas */
background: #fff;
border-radius: 10px;
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
overflow: hidden;
flex-shrink: 0;
padding: 1rem;
text-align: center;
/* La propiedad transform la maneja VanillaTilt.js */
}
/* Imagen dentro de la tarjeta */
.card img {
width: 100%;
border-radius: 5px;
margin-bottom: 1rem;
}
/* -----------------------
NAV BUTTONS (Prev, Next)
------------------------ */
.nav-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 2rem;
border: none;
background: rgba(255, 255, 255, 0.3);
color: #444;
cursor: pointer;
padding: 0.5rem 1rem;
border-radius: 50%;
z-index: 10;
transition: background 0.3s;
}
/* Hover en botones */
.nav-btn:hover {
background: rgba(255, 255, 255, 0.7);
}
/* Botón de posición */
#btnPrev {
left: 10px;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0