尝试使用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。任何想法如何解决它?
答案 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
}
}
}
});
我希望能帮到你