js+css实现自适应幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:js+css实现自适应幻灯片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
/* --- UTILITY CLASSES --- */
.flex-center-all {
display: flex;
align-items: center;
justify-content: center;
}
.pos-center-all {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* ----------------------- */
.wrapper {
height: 100vh;
position: relative;
background: #eee;
}
.img-container {
width: 60vw;
height: 60vw;
}
img {
width: 100%;
height: 100%;
/* object-fit: cover; */
}
.visible {
display: inline;
transition: all 0.125s;
}
.hidden {
display: none;
transition: all 0.125s;
}
.next-prev-btns {
position: absolute;
height: 10vh;
width: 100vw;
display: flex;
justify-content: space-between;
padding: 0 7vw;
align-items: center;
}
.prev-btn-container,
.next-btn-container {
height: 8vw;
width: 8vw;
}
button {
background: none;
border: 0;
font-size: 10vw;
border-radius: 50%;
background: #387ca1;
width: 100%;
height: 100%;
padding-bottom: 1.25vw;
color: #ddd;
transition: all 0.125s;
}
button:hover {
cursor: pointer;
background: #54b9f0;
color: white;
transition: all 0.125s;
}
.img-nav-container {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0