Tag: css

Sailsjs在EJS模板中没有CSS

我试图呈现一个模板使用: res.render('template', data, function(err, html) { … }); 在模板中我有: <link rel="stylesheet" type="text/css" href="/styles/style.css"> 它不工作(检查与红色背景)。 相同的标记在取决于views / layout.ejs的页面中工作,即使用: <link rel="stylesheet" type="text/css" href="/styles/style.css"> 我怎样才能解决这个问题(将style.css添加到ejs文件)? HTML <html> <head> <link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="/styles/style.css"> </head> <body> … </body> </html>

Node.js app.js不是显示HTML页面,而是HTML代码

我的问题与我的app.js节点不显示我的HTML页面,而是我的HTML代码。 我真的不知道该怎么做,所以一些帮助将不胜感激。 我想能够从我的公用文件夹加载HTML,JavaScript和CSS。 这是我的app.js代码: var http = require("http"), url = require("url"), path = require("path"), fs = require("fs") http.createServer(function(request, response) { var uri = url.parse(request.url).pathname , filename = path.join(process.cwd(), uri); path.exists(filename, function(exists) { if(!exists) { response.writeHead(404, {"Content-Type": "text/plain"}); response.write("404 Not Found\n"); response.end(); return; } if (fs.statSync(filename).isDirectory()) filename += 'public/index.html'; fs.readFile(filename, "binary", function(err, file) { if(err) { […]

渲染pdf时,PhantomJs将页眉边距设置为0

我正在使用Node.js和模块phridge(版本1.0.3)来渲染与PhantomJs的pdf。 我想在页眉和页脚中没有任何页边空白的情况下渲染pdf。 目前,我只发现一个黑客通过负左右边距去除左右边距。 用pagenumbers打印页眉和页脚的例子可以在这里find: https : //github.com/ariya/phantomjs/blob/master/examples/printheaderfooter.js // creates a new webpage internally var page = phantom.createPage(), outputFile = path.join(options.destDir, options.destFile); /*global window:false */ // page.run(fn) runs fn inside PhantomJS page.run(html, outputFile, options.header, options.footer, options.delay, function (html, outputFile, header, footer, delay, resolve /*, reject*/) { // Here we're inside PhantomJS, so we can't reference variables […]

使用抓取工具查找多个网站的字体系列

我正在寻找一个给定的页面上的特定元素(如h1)使用的字体家族。 我正在使用节点js npm爬虫遍历50个或更多站点的列表。 我第一次尝试使用: $( "h1" ).css( "font-family" ); 但是,这只会获得大多数网站不用于字体的内联样式。 我已经看过其他的方法,如window.getComputedStyle和这个,但这些方法(和类似的)使用窗口和文件,我不认为是在节点支持。 他们也可能使用ID和类来select我不会有的元素,因为我将爬行多个网站。 有什么build议么?

uncss错误:C.UTF-8:不是有效的语言标记

嗨我想使用UNCSS第一次从CSS中删除不使用的样式,我得到以下错误: Fontconfig警告:忽略C.UTF-8:不是有效的语言标记 /home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/bluebird/js/main/async.js:43 fn = function(){throw arg; }; ^错误:Fontconfig警告:忽略C.UTF-8:不是有效的语言标记 at Socket.onStderr (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/phridge/lib/spawn.js:79:28) at Socket.emit (events.js:117:20) at Socket.<anonymous> (_stream_readable.js:765:14) at Socket.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:427:10) at emitReadable (_stream_readable.js:423:5) at readableAddChunk (_stream_readable.js:166:9) at Socket.Readable.push (_stream_readable.js:128:10) at Pipe.onread (net.js:529:21) 我甚至尝试使用Gulp,我一直在寻找一个解决scheme,我不理解输出来解决它。 任何帮助解决这个将不胜感激。 -j

离子 – 不能开始吞咽

运行后: ionic setup sass 并安装所有的依赖关系,当我尝试开始gulp ,我有这个错误,而不是: /Users/user/Sites/ionic/project/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22 throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?'); ^ Error: `libsass` bindings not found. Try reinstalling `node-sass`? 我试图重新安装节点sass,但迄今为止没有成功。 任何想法如何解决这个问题? 谢谢!

如何在基于angular-fullstack的应用程序中包含库文件(css / js)

我使用了一个Yo Angular-Fullstack生成器( https://github.com/DaftMonk/generator-angular-fullstack ),并启动了一个应用程序,然后尝试从凉亭通过做安装Toastr – bower install angular-toastr 现在我想添加toastr css和js文件。 他们位于 bower_components/angular-toastr/dist 现在我如何将它们包含在当前项目中,以便在使用grunt构build应用程序时将它们包含在dist文件夹中。 文件夹结构如下 – ├── client │ ├── app – All of our app specific components go in here │ ├── assets – Custom assets: fonts, images, etc… │ ├── components – Our reusable components, non-specific to to our app │ ├── e2e – […]

无法使用Jade在选项卡内插入表格

我对Jade框架相当陌生。 我想插入一个表格里面的一个选项卡div,但玉,但我无法。 这是我有多远: 正如你可以看到的内容说空白(白线),其次是标签2的内容,其次是标签1的内容。这是我的玉代码: .tabs ul.tab-links li.active a(href='#tab1') Tab #1 li a(href='#tab2') Tab #2 .tab-content #tab1.tab.active div.row(ng-cloak, style="padding-top: 10px") table.table.table-striped thead tr.text-info th.th-nodecheck i.icon-check-o(data-toggle="tooltip", data-placement="top", title="Pin nodes to display first", ng-click="orderTable(['-stats.block.number', 'stats.block.propagation'], false)") th.th-nodename i.icon-node(data-toggle="tooltip", data-placement="top", title="Node name", ng-click="orderTable(['info.name'], false)") th.th-nodetype i.icon-laptop(data-toggle="tooltip", data-placement="top", title="Node type", ng-click="orderTable(['info.node'], false)") th.th-latency i.icon-clock(data-toggle="tooltip", data-placement="top", title="Node latency", ng-click="orderTable(['stats.latency'], false)") th […]

从请求模块接收的身体是否保存了计算的CSS?

我有下面的代码,我想下载整个HTML与他们各自的计算的CSS,并将其转换成JSON。 我正在尝试请求模块。 request('http://www.modulus.io', function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); // Show the HTML for the Modulus homepage. } }); 身体只是有html还是会有一切? 我如何获得所需的CSS。

有没有可能改变webview内容的样式?

我想在我的电子应用程序中加载一个webview ,然后调整对象内容的样式。 无论是由JS或CSS是无关紧要的,我只是想能够.hide()或visibility: none在webview visibility: none元素。 这可能吗? 事实certificate很难发现。 谢谢!