css+js实现响应式自适应头部幻灯片多主题颜色切换页面代码
代码语言:html
所属分类:响应式
代码描述:css+js实现响应式自适应头部幻灯片多主题颜色切换页面代码
代码标签: css js 响应式 自适应 头部 幻灯片 多主题 颜色 切换
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Domine&family=Josefin+Sans:wght@400;600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary: #c62641;
--black: #333333;
--white: #fcfcfc;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
font-family: "Josefin Sans", serif;
color: var(--black);
}
h1,
h2,
h3 {
font-family: "Domine", sans-serif;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: var(--primary);
z-index: 1;
transition: background-color 0.5s;
-webkit-transition: background-color 0.5s;
-moz-transition: background-color 0.5s;
-ms-transition: background-color 0.5s;
-o-transition: background-color 0.5s;
}
.page-wrapper {
width: 100%;
background-color: var(--white);
background-image: url("//repo.bfw.wiki/bfwrepo/icon/63901f566b1f1.png");
display: grid;
justify-items: center;
translate: 0 100vh;
position: relative;
z-index: 2;
}
.page-content {
width: 100%;
max-width: 1170px;
background-color: var(--white);
padding: 6em 12em;
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px,
rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
translate: 0 -20vh;
}
.page-content h3 {
font-size: clamp(1.8rem, 5vw, 3rem);
margin-bottom: 0.3em;
}
.page-content h3 ~ p:not(.lead-text) {
display: none;
}
.page-content > p {
line-height: 1.5rem;
font-size: 1.2rem;
opacity: 0.8;
}
.page-content h4 {
text-align: center;
margin-bottom: 6em;
text-transform: uppercase;
font-size: 1.1rem;
letter-spacing: 2px;
}
.button-container {
margin: 3em 0 10em;
}
.button-container button {
width: 130px;
height: 38px;
text-transform: uppercase;
font-famil.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0