页面不会禁用滚动

时间:2016-10-04 19:15:39

标签: html css

无论出于何种原因,即使我关闭溢出,我的1600x1200图像也会保持滚动状态,这是我认为可以做到的。这是我的代码......

$(function() {

    $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(data) {
        // Create the chart
        window.chart = new Highcharts.StockChart({
            chart: {
                renderTo: 'container'
            },

            rangeSelector: {
                selected: 1,
                inputDateFormat: '%Y-%m-%d'
            },

            title: {
                text: 'AAPL Stock Price'
            },

            series: [{
                name: 'AAPL',
                data: data,
                tooltip: {
                    valueDecimals: 2
                }}]

        }, function(chart) {

            // apply the date pickers
            setTimeout(function() {
                $('input.highcharts-range-selector', $('#' + chart.options.chart.renderTo)).datepicker()
            }, 0)
        });
    });


    // Set the datepicker's date format
    $.datepicker.setDefaults({
        dateFormat: 'yy-mm-dd',
        onSelect: function(dateText) {
            this.onchange();
            this.onblur();
        }
    });

});

}

body#login{
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.7) 100%), url('images/login_images/background.jpg');
background-size: auto 100%;
background-repeat: no-repeat;
background-position: center; 
overflow: hidden;

即使我将溢出设置为隐藏,也会创建一个小的水平和垂直滚动。当我看到我的图标偏离中心时,我首先注意到了这一点。

知道为什么会这样吗?

1 个答案:

答案 0 :(得分:0)

主体在浏览器的默认样式表中有边距或填充。

将HTML和BODY元素设置为:padding:0;

相关问题