html - 页面不滚动,文本不出现在标题下方,在正文中
问题描述
有人可以帮帮我吗。我遇到了一个问题,我的页面没有向下滚动,段落没有出现在正文中,而是出现在页面的标题中。我已经从 CSS 中删除了所有不必要的溢出元素,但这并没有做任何事情。
https://codepen.io/arvindr2002/pen/oNzzMQb。谢谢你。
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Raleway', sans-serif;
background-color: black;
}
header {
background-image: url(../images/Game.jpg);
height: 100%;
width: 100%;
-webkit-background-size: cover;
background-size: cover;
background-position: right-side;
position: fixed;
}
nav {
position: fixed;
z-index: 10;
left: 0;
right: 0;
top: 0;
padding: 0 5%;
height: 45px;
background-color: #E94B3CFF;
}
nav .logo {
float: left;
width: 40%;
height: 100%;
display: flex;
align-items: center;
font-size: 24px;
color: #fff;
}
nav a:hover {
border-top: 2px red;
border-bottom: 4px solid white;
padding: 6px 0;
}
nav .nav-area {
float: right;
padding: 0;
margin: 0;
width: 60%;
height: 100%;
display: flex;
justify-content: space-around;
align-items: center;
}
nav .nav-area li {
list-style: none;
}
nav .nav-area a {
display: block;
padding: 1em;
font-size: 16px;
font-weight: bold;
color: #fff;
text-decoration: none;
}
#nav-toggle {
position: absolute;
top: -100px;
}
nav .icon-burger {
display: none;
position: absolute;
right: 5%;
top: 50%;
transform: translateY(-50%);
}
nav .icon-burger .line {
width: 30px;
height: 5px;
background-color: #fff;
margin: 5px;
border-radius: 3px;
transition: all .3s ease-in-out;
}
@media screen and (max-width: 768px) {
nav .logo {
float: none;
width: auto;
justify-content: center;
}
nav .nav-area { /* transforing toggle-bar */
float: none;
position: fixed;
z-index: 9;
left: 0;
right: 0;
top: 100px;
bottom: 100%;
width: auto;
height: auto;
flex-direction: column;
justify-content: space-evenly;
background-color: rgba(0,0,0,.8);
box-sizing: border-box;
transition: all .5s ease-in-out;
}
nav .a {
font-size: 20px;
}
nav :checked ~ .nav-area {
bottom: 0;
}
nav .icon-burger {
display: block;
}
nav :checked ~ .icon-burger .line:nth-child(1) {
transform: translateY(10px) rotate(225deg);
}
nav :checked ~ .icon-burger .line:nth-child(3) {
transform: translateY(-10px) rotate(-225deg);
}
nav :checked ~ .icon-burger .line:nth-child(2) {
opacity: 0;
}
}
.welcome-text {
position: fixed;
width: 600px;
height: 300px;
margin: 25% 30%;
text-align: center;
}
.welcome-text h1 {
text-align: center;
color: #fff;
text-transform: uppercase;
font-size: 60px;
}
.welcome-text h1 span {
color: #E94B3CFF;
}
.glow{
position: relative;
display: inline-block;
padding: 20px 15px;
margin: 10px 1;
color: #E94B3CFF;
text-decoration: none;
text-transform: uppercase;
transition: 0.5s;
letter-spacing: 4px;
overflow: hidden;
margin-right: 20px;
}
.glow:hover{
background: #E94B3CFF;
color: #050801;
box-shadow: 0 0 5px #E94B3CFF,
0 0 25px #E94B3CFF,
0 0 50px #E94B3CFF,
0 0 200px #E94B3CFF;
-webkit-box-reflect:below 1px linear-gradient(transparent, #0005);
}
.glow span{
position: absolute;
display: block;
}
.glow span:nth-child(1){
top: 0;
left: 0;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,#E94B3CFF);
animation: animate1 1s linear infinite;
}
@keyframes animate1{
0%{
left: -100%;
}
50%,100%{
left: 100%;
}
}
.glow span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,#E94B3CFF);
animation: animate2 1s linear infinite;
animation-delay: 0.25s;
}
@keyframes animate2{
0%{
top: -100%;
}
50%,100%{
top: 100%;
}
}
.glow span:nth-child(3){
bottom: 0;
right: 0;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,#E94B3CFF);
animation: animate3 1s linear infinite;
animation-delay: 0.50s;
}
@keyframes animate3{
0%{
right: -100%;
}
50%,100%{
right: 100%;
}
}
.glow span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg,transparent,#E94B3CFF);
animation: animate4 1s linear infinite;
animation-delay: 0.75s;
}
@keyframes animate4{
0%{
bottom: -100%;
}
50%,100%{
bottom: 100%;
}
}/*resposive*/
解决方案
推荐阅读
- javascript - 为什么 Javascript addEventlistener 在另一个 addEventlistener 中不起作用
- javascript - 获取路线是正确的,但 api 仍然无法正常工作(什么都没有)
- c++ - 用 C++ 中的普通元音替换重读元音
- plotly - Plotly:如何在我的桑基图列上写一个文本?
- azure-active-directory - 尝试使用 Graph API 获取用户的频道并将消息从 Web 应用程序发布到 MS Teams 频道
- jsxgraph - Jsxgraph 旋转和 LaTex 文本
- docker - 在构建期间如何从 docker 文件打印到控制台?
- laravel - laravel 将变量从控制器传递给 js 文件
- autodesk-forge - Autodesk Forge:如何开始创建配置器
- docker - 如何在 Docker/Alpine 中安装 MariaDB ODBC 驱动程序