我有一个gulpfile.js在键入gulp命令行时完美运行.
所有gulpbash命令实际上都是调用package.json >> bin >> gulp全局安装的gulp中指定的js文件.
现在我想运行没有全局安装gulp的gulpfile,只需键入node gulpfile.js哪个明显失败并且已经经常被提及,尽管gulp在本地安装并且在开头需要gulpfile.js
使用没有cli工具的gulp可以很容易地将gulp用作其他npm插件的一部分.
注意:
当通过gulp cli工具启动此原始gulpfile.js时,需要另一个gulpfile.js从原始gulpfile.js开始工作.
问题:
在不需要全局cli gulp工具的情况下运行/需要gulp的最佳方法是什么(//编辑:或在本地链接到它)?例如,当gulp只是本地安装的依赖项时,能够简单地从另一个js文件中请求它.(换句话说,从JS内部以编程方式启动gulp,无需任何类型的CLI干预)
我的问题涉及根据浏览器窗口的宽度将Flex-Box包装(flex-wrap:wrap;)设置为多行:除了JavaScript之外,还有什么方法可以设计特定的行吗?
我们有以下div
<body>
<div class="flexwrap">
<div class=flexbox"></div>
<div class=flexbox"></div>
<div class=flexbox"></div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
以及样式表
.flexwrap {
display: -webkit-box;
-webkit-box-orient: horizontal;
display: -moz-box;
-moz-box-orient: horizontal;
display: flex;
box-orient: horizontal;
display: -ms-flexbox;
-ms-flex-direction: row;
flex-wrap: wrap;
}
.flexbox {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
flex-grow:1;
flex-shrink:0;
width:300px;
height:100px;
}
Run Code Online (Sandbox Code Playgroud)
当浏览器窗口的宽度超过900px时,具有.flexbox类的所有div将位于彼此相邻的单个水平线中.当浏览器窗口的宽度小于900px时,具有类.flexbox的div将分为2或3行,从而在浏览器宽度上展开.
我想要设置第二行中所有div的样式.这意味着以下内容:
Browser width > 900px = no div is styled
Browser width < 900px and Browser width > 600px = the third div is styed
Browser width < 600px = the …Run Code Online (Sandbox Code Playgroud) 正如之前多次询问过(但从未真正回答过)我希望将一个传奇集中在一个字段集中.
诀窍在这里完美完成,我也为我的项目购买了:http://themeforest.net/item/aloma-liquid-mobile-template/full_screen_preview/5819068
来自css的代码就是这样的
fieldset {
display: block;
margin: 20px 1%;
margin-bottom: 20px;
padding: 0 auto;
padding: 15px 0;
border: 0;
border-top: 1px solid #DDD;
width: 98%;
}
legend {
display: table;
min-width: 0px;
max-width: 70%;
position: relative;
margin: auto;
padding: 5px 20px;
color: #eee8aa;
font-size: 20px;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在我的项目中的另一个页面中重做它时,那不使用主题,我失败了.我在上面的代码中遗漏了什么吗?