我正在尝试使网站在100%滚动时仍可向下滚动,但无法正常工作,查看整个页面的唯一方法是缩小至80%以下是所有CSS和HTML。我尝试将Overflow:scroll放置在页面的主体中,但仍然无法正常工作。我仍然必须缩小以查看页面。
@charset "utf-8";
/* CSS Document */
body {
margin: 0;
}
#mainPage {
height: 1000px;
width: 100%;
background-color: #1e1e1e;
position: absolute;
z-index: -5;
}
#navBar {
height: 70px;
width: 100%;
Background-color: #1f1f1f;
position: fixed;
z-index: 1;
}
ul {
margin: 0;
list-style-type: none;
color: white;
display: block;
padding-top: 20px;
padding-left: 350px;
font-family: "Economica", sans-serif;
font-size: 28px;
text-decoration: none;
position: relative;
}
ul li {
display: inline;
text-decoration: none;
}
#Logo {
margin-left: 70px;
border: 0;
background-color: #1f1f1f;
font-family: "Economica";
font-size: 49px;
float: left;
color: white;
margin-top: 5px;
font-weight: bold;
}
#google {
margin-left: 45px;
}
img {
opacity: 0.3;
position: relative;
z-index: -3;
}
a {
text-decoration: none;
color: white;
}
#Events {
top: 120px;
left: 50px;
background-color: black;
width: 245px;
height: 370px;
position: absolute;
border-radius: 21px;
z-index: -2;
}
#eventList {
padding-top: 130px;
padding-left: 30px;
}
.event {
display: block;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 40px;
}
.lines {
width: 200px;
margin: 0;
margin-top: 6px;
margin-bottom: 0;
}
.highlight {
Padding-top: 20px;
padding-bottom: 17px;
padding-left: 44px;
padding-right: 44px;
}
#select a:hover {
background-color: #383838;
transition: ease 0.2s;
}
#eventList a:hover {
background-color: rgba(255, 255, 255, 0.4);
color: #ffe700;
transition: ease 0.7s;
}
.eventLight {
padding-right: 70px;
padding-top: 17px;
border-radius: 6px;
padding-left: 10px;
padding-bottom: 3px;
}
#upComing {
height: 300px;
position: absolute;
padding-left: 450px;
font-family: "economica";
font-size: 65px;
color: white;
padding-top: 175px;
}
#box {
background-color: rgba(255, 255, 255, 0.3);
width: 800px;
height: 195px;
border-radius: 10px;
font-size: 35px;
padding-left: 10px;
}
#entireBox {
width: 810px;
height: 195px;
border-radius: 17px;
border: 5px solid black;
margin-top: 40px;
}
#drake {
background-color: rgba(255, 255, 255, 0.3);
width: 410px;
height: 135px;
border-radius: 10px;
font-family: "economica";
font-size: 35px;
color: white;
padding-left: 15px;
padding-top: 5px;
}
#drakeBorder {
width: 425px;
height: 140px;
border-radius: 15px;
border: 5px solid black;
}
#ovo {
height: 200px;
position: absolute;
padding-left: 450px;
padding-top: 545px;
}
#circle1 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 485px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle1 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 485px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle2 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 635px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle3 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 829px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle4 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 1010px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#wembley {
position: absolute;
border: 0;
width: 95px;
height: 37px;
margin-top: -27px;
opacity: 1;
}
#mobile {
margin: 0;
margin-top: 0;
width: 250px;
height: 1000px;
background-color: #333333;
margin-left: -600px;
position: absolute;
z-index: -5;
}
.slider {
border: none;
background-color: white;
height: 3px;
width: 45px;
margin-top: 10px;
border-radius: 15px;
transition: ease 1s;
}
#slideButton {
background-color: rgba(255, 255, 255, 0);
border: 0;
margin-top: 12px;
margin-left: 15px;
padding-right: 7px;
padding-top: 7px;
position: fixed;
border-radius: 5px;
padding-left: 18px;
visibility: hidden;
}
#slideButton:focus {
outline: none;
}
#slideButton:hover {
background-color: rgba(100, 100, 100, 0.1);
transition: ease 0.6s;
}
#listMobile {
margin-top: 100px;
margin-left: -318px;
}
.smallList {
display: block;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 0;
font-size: 45px;
}
#line {
position: fixed;
margin-top: 83px;
width: 250px;
border: none;
height: 2px;
background-color: #646464;
}
.rainbow-button {
width: 134px;
height: 70px;
background-image: linear-gradient(90deg, #00C0FF 0%, #FFCF00 49%, #FC4F4F 80%, #00C0FF 100%);
display: flex;
justify-content: center;
font-size: 28px;
margin-left: 350px;
margin-top: 0;
font-family: economica;
position: fixed;
color: #ffe700;
}
.rainbow-button:after {
content: attr(title);
width: 134px;
height: 67px;
background-color: #1f1f1f;
display: flex;
align-items: center;
justify-content: center;
}
.rainbow-button:hover {
background-color: #383838;
animation: slidebg 2s linear infinite;
}
@keyframes slidebg {
to {
background-position: 20vw;
}
}
body {
overflow: hidden;
}
.holder {
width: 500px;
height: 250px;
position: fixed;
margin-top: -220px;
}
.holder .circle {
border-radius: 100% 100% 0 0;
position: absolute;
bottom: 0;
left: 0;
transform: translateX(-50%);
transform-origin: bottom center;
}
.holder .circle:nth-child(1) {
border: 2px solid white;
border-bottom: none;
border-radius: 0px 0px 0 0;
width: 0px;
height: 0px;
z-index: 15;
animation: circle-1 10s infinite ease-in-out;
}
@keyframes circle-1 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-360deg);
}
}
.holder .circle:nth-child(2) {
border: 2px solid white;
border-bottom: none;
border-radius: 11px 11px 0 0;
width: 11px;
height: 5.5px;
z-index: 14;
animation: circle-2 10s infinite ease-in-out;
}
@keyframes circle-2 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-720deg);
}
}
.holder .circle:nth-child(3) {
border: 2px solid white;
border-bottom: none;
border-radius: 22px 22px 0 0;
width: 22px;
height: 11px;
z-index: 13;
animation: circle-3 10s infinite ease-in-out;
}
@keyframes circle-3 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1080deg);
}
}
.holder .circle:nth-child(4) {
border: 2px solid white;
border-bottom: none;
border-radius: 33px 33px 0 0;
width: 33px;
height: 16.5px;
z-index: 12;
animation: circle-4 10s infinite ease-in-out;
}
@keyframes circle-4 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1440deg);
}
}
.holder .circle:nth-child(5) {
border: 2px solid white;
border-bottom: none;
border-radius: 44px 44px 0 0;
width: 44px;
height: 22px;
z-index: 11;
animation: circle-5 10s infinite ease-in-out;
}
@keyframes circle-5 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1800deg);
}
}
.holder .circle:nth-child(6) {
border: 2px solid white;
border-bottom: none;
border-radius: 55px 55px 0 0;
width: 55px;
height: 27.5px;
z-index: 10;
animation: circle-6 10s infinite ease-in-out;
}
@keyframes circle-6 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-2160deg);
}
}
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="IceArenaHome.css">
<title>
Ice Arena
</title>
<link href="https://fonts.googleapis.com/css?family=Economica" rel="stylesheet">
</head>
<body>
<div id="mainPage">
<div id="ovo">
<div id="drakeBorder">
<div id="drake">
Be here when rappers <span style="color:#ffe700;">X</span> and <span style="color:#ffe700;">Y</span> will be performing live on stage.
</div>
</div>
</div>
<div id="upComing">
Upcoming Events:
<div id="entireBox">
<div id="box">
Make sure you are here when <br>these two teams clash in the<span style="opacity:0;">.............<!-- i used these full stops to push my text to the right --> ......</span> <span style="color:#ffe700; font-size:40px;">Manchester United vs Ajax</span><br> biggest match in European <br> football the Europa league final.
</div>
</div>
</div>
<img src="http://xoio.de/wp-content/uploads/2013/08/GMP_Tokyo_Stadium_Concert_interiorvisual_by_xoio1.jpg" alt="concert stadium" style="width:100%; position:absolute; padding-top:70px; height:930px">
<div id="navBar">
<div id="circle1" class="circles">
</div>
<div id="circle2" class="circles">
</div>
<div id="circle3" class="circles">
</div>
<div id="circle4" class="circles">
</div>
<div id="Logo">
<div class="holder">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div> <span id="google">Ice Arena</span>
</div>
<ul id="select">
<li>
<a class="highlight" style="color:#ffe700;">Home
</a> </li>
<li><a class="highlight" href="IceArenaGallery.html">
Gallery
</a> </li>
<li> <a class="highlight" href="IceArenaOrderForm.html">
Order Form
</a> </li>
<li> <a class="highlight" href="#">
The Arena
</a></li>
<li><a class="highlight" href="#">
Contact Us
</a> </li>
</ul>
</div>
<ul id="eventList">
<li class="event"><a class="eventLight" href="#">
All<strong style="opacity:0;">.....................</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Sports <strong style="opacity:0;">.............</strong>
</a>
<hr class="lines"> </li>
<li class="event"><a class="eventLight" href="#">
Music<strong style="opacity:0;">...............</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Family<strong style="opacity:0;">..............</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Comedy<strong style="opacity:0;">............</strong>
</a>
<hr class="lines"> </li>
<li class="event"><a class="eventLight" href="#">
Performance<strong style="opacity:0;">...</strong>
</a></li>
</ul>
<div id="Events" style="opacity:0.4;">
</div>
</div>
</body>
<a href="#" class="rainbow-button" title="Home"></a>
</html>
答案 0 :(得分:1)
尝试添加:
html{
overflow-y: scroll;
}
答案 1 :(得分:0)
Css的“ overflow-y:scroll”将按您期望的那样创建滚动。
@charset "utf-8";
/* CSS Document */
body {
margin: 0;
}
html {
overflow-y: scroll;
}
#mainPage {
height: 1000px;
width: 100%;
background-color: #1e1e1e;
position: absolute;
z-index: -5;
}
#navBar {
height: 70px;
width: 100%;
Background-color: #1f1f1f;
position: fixed;
z-index: 1;
}
ul {
margin: 0;
list-style-type: none;
color: white;
display: block;
padding-top: 20px;
padding-left: 350px;
font-family: "Economica", sans-serif;
font-size: 28px;
text-decoration: none;
position: relative;
}
ul li {
display: inline;
text-decoration: none;
}
#Logo {
margin-left: 70px;
border: 0;
background-color: #1f1f1f;
font-family: "Economica";
font-size: 49px;
float: left;
color: white;
margin-top: 5px;
font-weight: bold;
}
#google {
margin-left: 45px;
}
img {
opacity: 0.3;
position: relative;
z-index: -3;
}
a {
text-decoration: none;
color: white;
}
#Events {
top: 120px;
left: 50px;
background-color: black;
width: 245px;
height: 370px;
position: absolute;
border-radius: 21px;
z-index: -2;
}
#eventList {
padding-top: 130px;
padding-left: 30px;
}
.event {
display: block;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 40px;
}
.lines {
width: 200px;
margin: 0;
margin-top: 6px;
margin-bottom: 0;
}
.highlight {
Padding-top: 20px;
padding-bottom: 17px;
padding-left: 44px;
padding-right: 44px;
}
#select a:hover {
background-color: #383838;
transition: ease 0.2s;
}
#eventList a:hover {
background-color: rgba(255, 255, 255, 0.4);
color: #ffe700;
transition: ease 0.7s;
}
.eventLight {
padding-right: 70px;
padding-top: 17px;
border-radius: 6px;
padding-left: 10px;
padding-bottom: 3px;
}
#upComing {
height: 300px;
position: absolute;
padding-left: 450px;
font-family: "economica";
font-size: 65px;
color: white;
padding-top: 175px;
}
#box {
background-color: rgba(255, 255, 255, 0.3);
width: 800px;
height: 195px;
border-radius: 10px;
font-size: 35px;
padding-left: 10px;
}
#entireBox {
width: 810px;
height: 195px;
border-radius: 17px;
border: 5px solid black;
margin-top: 40px;
}
#drake {
background-color: rgba(255, 255, 255, 0.3);
width: 410px;
height: 135px;
border-radius: 10px;
font-family: "economica";
font-size: 35px;
color: white;
padding-left: 15px;
padding-top: 5px;
}
#drakeBorder {
width: 425px;
height: 140px;
border-radius: 15px;
border: 5px solid black;
}
#ovo {
height: 200px;
position: absolute;
padding-left: 450px;
padding-top: 545px;
}
#circle1 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 485px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle1 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 485px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle2 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 635px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle3 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 829px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#circle4 {
width: 10px;
height: 10px;
background-color: white;
position: absolute;
margin-left: 1010px;
margin-top: 30px;
border: 3px solid black;
border-radius: 50px;
}
#wembley {
position: absolute;
border: 0;
width: 95px;
height: 37px;
margin-top: -27px;
opacity: 1;
}
#mobile {
margin: 0;
margin-top: 0;
width: 250px;
height: 1000px;
background-color: #333333;
margin-left: -600px;
position: absolute;
z-index: -5;
}
.slider {
border: none;
background-color: white;
height: 3px;
width: 45px;
margin-top: 10px;
border-radius: 15px;
transition: ease 1s;
}
#slideButton {
background-color: rgba(255, 255, 255, 0);
border: 0;
margin-top: 12px;
margin-left: 15px;
padding-right: 7px;
padding-top: 7px;
position: fixed;
border-radius: 5px;
padding-left: 18px;
visibility: hidden;
}
#slideButton:focus {
outline: none;
}
#slideButton:hover {
background-color: rgba(100, 100, 100, 0.1);
transition: ease 0.6s;
}
#listMobile {
margin-top: 100px;
margin-left: -318px;
}
.smallList {
display: block;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 0;
font-size: 45px;
}
#line {
position: fixed;
margin-top: 83px;
width: 250px;
border: none;
height: 2px;
background-color: #646464;
}
.rainbow-button {
width: 134px;
height: 70px;
background-image: linear-gradient(90deg, #00C0FF 0%, #FFCF00 49%, #FC4F4F 80%, #00C0FF 100%);
display: flex;
justify-content: center;
font-size: 28px;
margin-left: 350px;
margin-top: 0;
font-family: economica;
position: fixed;
color: #ffe700;
}
.rainbow-button:after {
content: attr(title);
width: 134px;
height: 67px;
background-color: #1f1f1f;
display: flex;
align-items: center;
justify-content: center;
}
.rainbow-button:hover {
background-color: #383838;
animation: slidebg 2s linear infinite;
}
@keyframes slidebg {
to {
background-position: 20vw;
}
}
body {
overflow: hidden;
}
.holder {
width: 500px;
height: 250px;
position: fixed;
margin-top: -220px;
}
.holder .circle {
border-radius: 100% 100% 0 0;
position: absolute;
bottom: 0;
left: 0;
transform: translateX(-50%);
transform-origin: bottom center;
}
.holder .circle:nth-child(1) {
border: 2px solid white;
border-bottom: none;
border-radius: 0px 0px 0 0;
width: 0px;
height: 0px;
z-index: 15;
animation: circle-1 10s infinite ease-in-out;
}
@keyframes circle-1 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-360deg);
}
}
.holder .circle:nth-child(2) {
border: 2px solid white;
border-bottom: none;
border-radius: 11px 11px 0 0;
width: 11px;
height: 5.5px;
z-index: 14;
animation: circle-2 10s infinite ease-in-out;
}
@keyframes circle-2 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-720deg);
}
}
.holder .circle:nth-child(3) {
border: 2px solid white;
border-bottom: none;
border-radius: 22px 22px 0 0;
width: 22px;
height: 11px;
z-index: 13;
animation: circle-3 10s infinite ease-in-out;
}
@keyframes circle-3 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1080deg);
}
}
.holder .circle:nth-child(4) {
border: 2px solid white;
border-bottom: none;
border-radius: 33px 33px 0 0;
width: 33px;
height: 16.5px;
z-index: 12;
animation: circle-4 10s infinite ease-in-out;
}
@keyframes circle-4 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1440deg);
}
}
.holder .circle:nth-child(5) {
border: 2px solid white;
border-bottom: none;
border-radius: 44px 44px 0 0;
width: 44px;
height: 22px;
z-index: 11;
animation: circle-5 10s infinite ease-in-out;
}
@keyframes circle-5 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-1800deg);
}
}
.holder .circle:nth-child(6) {
border: 2px solid white;
border-bottom: none;
border-radius: 55px 55px 0 0;
width: 55px;
height: 27.5px;
z-index: 10;
animation: circle-6 10s infinite ease-in-out;
}
@keyframes circle-6 {
0% {
transform: translateX(-50%) rotate(0deg);
}
100% {
transform: translateX(-50%) rotate(-2160deg);
}
}
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="IceArenaHome.css">
<title>
Ice Arena
</title>
<link href="https://fonts.googleapis.com/css?family=Economica" rel="stylesheet">
</head>
<body>
<div id="mainPage">
<div id="ovo">
<div id="drakeBorder">
<div id="drake">
Be here when rappers <span style="color:#ffe700;">X</span> and <span style="color:#ffe700;">Y</span> will be performing live on stage.
</div>
</div>
</div>
<div id="upComing">
Upcoming Events:
<div id="entireBox">
<div id="box">
Make sure you are here when <br>these two teams clash in the<span style="opacity:0;">.............<!-- i used these full stops to push my text to the right --> ......</span> <span style="color:#ffe700; font-size:40px;">Manchester United vs Ajax</span><br> biggest match in European <br> football the Europa league final.
</div>
</div>
</div>
<img src="http://xoio.de/wp-content/uploads/2013/08/GMP_Tokyo_Stadium_Concert_interiorvisual_by_xoio1.jpg" alt="concert stadium" style="width:100%; position:absolute; padding-top:70px; height:930px">
<div id="navBar">
<div id="circle1" class="circles">
</div>
<div id="circle2" class="circles">
</div>
<div id="circle3" class="circles">
</div>
<div id="circle4" class="circles">
</div>
<div id="Logo">
<div class="holder">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div> <span id="google">Ice Arena</span>
</div>
<ul id="select">
<li>
<a class="highlight" style="color:#ffe700;">Home
</a> </li>
<li><a class="highlight" href="IceArenaGallery.html">
Gallery
</a> </li>
<li> <a class="highlight" href="IceArenaOrderForm.html">
Order Form
</a> </li>
<li> <a class="highlight" href="#">
The Arena
</a></li>
<li><a class="highlight" href="#">
Contact Us
</a> </li>
</ul>
</div>
<ul id="eventList">
<li class="event"><a class="eventLight" href="#">
All<strong style="opacity:0;">.....................</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Sports <strong style="opacity:0;">.............</strong>
</a>
<hr class="lines"> </li>
<li class="event"><a class="eventLight" href="#">
Music<strong style="opacity:0;">...............</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Family<strong style="opacity:0;">..............</strong>
</a>
<hr class="lines">
</li>
<li class="event"><a class="eventLight" href="#">
Comedy<strong style="opacity:0;">............</strong>
</a>
<hr class="lines"> </li>
<li class="event"><a class="eventLight" href="#">
Performance<strong style="opacity:0;">...</strong>
</a></li>
</ul>
<div id="Events" style="opacity:0.4;">
</div>
</div>
</body>
<a href="#" class="rainbow-button" title="Home"></a>
</html>