1

I have a simple CSS loading indicator for a basic web app that uses Webkit radial gradients and animation. However, during the loading process, both the horizontal and vertical scrollbars appear.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="nofollow">
<title>Resident Manager Portal</title>
<link rel="shortcut icon" href="resources/icons/favicon.ico">
<style type="text/css">
html, body {
width: 100%;
height: 100%;
background-image: -webkit-radial-gradient(center, ellipse contain, #00AED9 0%, #0075B0 100%)
}
#appLoadingIndicator {
position: absolute;
top: 50%;
margin-top: -15px;
width: 100%;
height: 30px;
text-align: center
}
#appLoadingIndicator > * {
display: inline-block;
width: 30px;
height: 30px;
background-color: #FFFFFF;
opacity: 0;
-webkit-border-radius: 10px;
margin: 0 5px;
-webkit-animation-name: appLoadingIndicator;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: normal;
}
#appLoadingIndicator > :nth-child(1) {
-webkit-animation-delay: 0s;
}
#appLoadingIndicator > :nth-child(2) {
-webkit-animation-delay: 0.5s;
}
#appLoadingIndicator > :nth-child(3) {
-webkit-animation-delay: 1s;
}
@-webkit-keyframes appLoadingIndicator{
20% {
opacity: 0
}
50% {
opacity: 1
}
80% {
opacity: 0
}
}
</style>
</head>
<body>
<div id="appLoadingIndicator">
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>

I can add overflow-x: hidden; and overflow-y: hidden; to hide the bars, but I don't see anywhere the content is overflowing. Any suggestions?

2
  • Always use a CSS reset. Commented Mar 28, 2013 at 18:26
  • A jsFiddle would be nice. Commented Mar 28, 2013 at 18:28

1 Answer 1

3

The width and height of the page is 100% + the standard margin so it's overflowing. Try removing the margin with:

html, body {
   margin:0;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.