disable vertical scrolling on a div/img

谁说我不能喝 提交于 2019-12-04 14:02:50
user1

You will need to use CSS for that.

div {
    overflow-x: hidden;
} 

Should work by itself if you just set it as a background image, centered. You'll need to put it on a div that has 100% width applied to it, and a height specified in order to expand the div to see anything.

Try position: fixed; This fixes the position and doesn't allow any scrolling

You need to make the image a background of it's containing div.

<html>
<body>
    <div id="outer"
         style="width:100%; overflow-x:hidden;">  
        <div id="inner"
             style="margin: 0 auto;
                    width:100%, 
                    background: url('image.jpg') 50% 0; 
                    max-width: 1300px;">
        </div>
    </div>
</body>
</html>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!