Heiko Matthies Heiko Matthies - 1 year ago 68
CSS Question

Scrolling not possible on own Website

At the moment, I have the following settings in my CSS-Stylesheet:

.Body {
background-color: #303030;
background-image: url("Background.png");
background-attachment: scroll;
background-size: cover;
display: block;
background-position: top;
background-repeat: no-repeat;

<link rel="stylesheet" type="text/css" href="style.css">
<body class="Body">
<img class="Header" src="Header.png">

I made these settings to assure that the background is responsive which perfectly works right now.
But I have the problem that I can't scroll down the page which means that no scrollbar is shown.
Otherwise, when I set the width of the image to 100% and my height to 6572px, everything works perfectly
BTW: My image resolution is 1920 x 6572.

PS: I must apologize for my weird English, but it isn't my native language

Answer Source


Try adding a

<img class='im' src='Background.png'>

right after body tag with css:

body {
    margin: 0;
    overflow-x: hidden;
    height: auto;


Here you have a working example: https://codepen.io/jjyepez/pen/AXNorQ

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download