小编use*_*929的帖子

媒体查询无法在Firefox上运行

我一直在为这项新技术(响应设计)工作,我讨厌我不知道答案的问题,我感到沮丧:/

这是我的代码:http://jsbin.com/ejadej/1

使用最新版本的Chrome,我看到该网站应该如何通过我的代码,而Firefox不会阅读此媒体查询

@media screen and(min-width: 960px) {
    #php-info-title {
        background-color: #322E2C;
        position: absolute;
        left:100px;
        bottom: 0px;
        color:white;
        z-index: 0;
        max-width: 300px;
    }
}
Run Code Online (Sandbox Code Playgroud)

它只是忽略它(如果我删除媒体查询它运作良好,但我不想这样做).

奇怪的是,通过上面写的其他媒体查询,Firefox运行良好.

Firefox发生了什么?

谢谢你的帮助.

firefox css3 media-queries

1
推荐指数
1
解决办法
8958
查看次数

gulp-inject正在给出错误的相对路径

我一直无法使用这个有用的工具,我不知道该怎么办,这就是我来这里寻求帮助的原因.

这是我的目录结构:

 - Project root
 |-  dist
     |-css
     |-js

 |-  source
     |- css
     |- js
     |-index.html

 |-gulpfile.js
 |-index.html 
Run Code Online (Sandbox Code Playgroud)

所以,我正在使用gulp从源文件夹中将我的css,js注入到我的dist文件夹中,缩小,连接等等.然后,将其注入我的index.html中的源文件夹并吐入项目根文件夹.这是代码:

//Injects assets (css,js) into index.html automatically
gulp.task('inject',['sass','concat-css','concat-js'],function(){
    //Target to inject
    var target = gulp.src('source/index.html');


    //Sources to be injected

    var cssFiles = gulp.src('./dist/assets/css/*.css',{read:false});
    var jsFiles = gulp.src('./dist/assets/js/*.js',{read:false});
    //Merge resources into one
    var sources = es.merge(cssFiles,jsFiles);


    //Injecting bower.json dependencies and other resources

    return target.pipe(inject(sources),{
       ignorePath:'dist/',
        addRootSlash:false
    })
        .pipe(wiredep({ignorePath:'../'}))
        .pipe(gulp.dest('./'));

   });
Run Code Online (Sandbox Code Playgroud)

问题是index.html上dist文件夹的路径是这样的:

"/dist/css/stylesheet.css"
Run Code Online (Sandbox Code Playgroud)

导致错误,因为它应该是:`"dist/css/stylesheet.css"

正如您在代码中看到的,我使用了inject的选项,ignorePath,addRootSlash,relative:true,似乎没有任何效果.同样的事情发生在wiredep上,但是这个接受了ignorePath选项,所以一切都很好.

在此先感谢您的帮助.

html npm gulp gulp-inject

1
推荐指数
1
解决办法
5109
查看次数

标签 统计

css3 ×1

firefox ×1

gulp ×1

gulp-inject ×1

html ×1

media-queries ×1

npm ×1