Grunt Pageres插件无法正确显示css后台网址

时间:2016-05-04 20:47:57

标签: npm gruntjs

尝试使用grunt的Pageres插件。除了来自css文件的背景图像之外还可以正常工作:

.parallax-2 { 
  width:100%;
  background: url(../images/bg-banner-1.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
 background-size: cover;
}

它显示缩放为1000x。任何想法如何解决它?

1 个答案:

答案 0 :(得分:0)

您可以定义图片的大小:

尺寸:['1200x800','800x600'],

grunt.initConfig({
    pageres: {
        screenshot: {
            options: {
                urls: 'yeoman.io',
                sizes: ['1200x800', '800x600'],
                dest: 'dist'
            }
        },
        multipleUrls: {
            options: {
                urls: ['todomvc.com', 'google.com'],
                sizes: ['800x1000', '400x1000'],
                dest: 'dist',
                crop: true
            }
        }
    }
});

我希望能帮到你