radio+js实现文字横向幻灯片切换效果代码
代码语言:html
所属分类:其他
代码描述:radio+js实现文字横向幻灯片切换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--dark-blue-text: #003781;
--dark-blue-bg: #122b54;
--light-blue: #f0f7fc;
--white: #fff;
}
.sr-only {
border: 0;
clip-path: inset(50%);
clip: rect(0, 0, 0, 0);
height: 1px;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
html {
box-sizing: border-box;
font-size: 62.5%;
height: 100%;
}
body {
-webkit-font-smoothing: antialiased;
align-items: center;
background-color: var(--white);
color: var(--dark-blue-text);
display: flex;
display: flex;
flex-direction: column;
font-family: "Livvic", sans-serif;
font-size: 1.6rem;
height: 100%;
justify-content: flex-start;
margin: 0;
overflow-x: hidden;
padding: 0;
line-height: 1.4;
}
.wrapper {
display: flex;
flex-direction: column;
gap: 1rem;
margin: 0 1.6rem;
max-width: 144rem;
width: 100%;
}
.my-section {
background-color: var(--light-blue);
padding: 2rem 0;
}
.my-section:has(.carousel-item:nth-of-type(1) input[type="radio"]:checked)
.top-link--mobile:nth-child(1),
.my-section:has(.carousel-item:nth-of-type(2) input[type="radio"]:checked)
.top-link--mobile:nth-child(2),
.my-section:has(.carousel-item:nth-of-type(3) input[type="radio"]:checked)
.top-link--mobile:nth-child(3),
.my-section:has(.carousel-item:nth-of-type(4) input[type="radio"]:checked)
.top-link--mobile:nth-child(4),
.my-section:has(.carousel-item:nth-of-type(5) input[type="radio"]:checked)
.top-link--mobile:nth-child(5) {
font-weight: bold;
}
.my-section:has(.carousel-item:nth-of-type(1) input[type="radio"]:checked)
.carousel-item:nth-of-type(1)
.top-link--desktop::after,
.my-section:has(.carousel-item:nth-of-type(2) input[type="radio"]:checked)
.carousel-item:nth-of-type(2)
.top-link--desktop::after,
.my-section:has(.carousel-item:nth-of-type(3) input[type="radio"]:checked)
.carousel-item:nth-of-type(3)
.top-link--desktop::after,
.my-section:has(.carousel-item:nth-of-type(4) input[type="radio"]:checked)
.carousel-item:nth-of-type(4)
.top-link--desktop::after,
.my-section:has(.carousel-item:nth-of-type(5) input[type="radio"]:c.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0