Node.js学习(三)——Node.js使用Bootstrap
来源:互联网 发布:linux 机器重启日志 编辑:程序博客网 时间:2024/05/16 11:09
Node.js学习(三)——Node.js使用Bootstrap
下载bootstrap
npm install bootstrap
下载jquery
npm install jquery
配置使用
文件放置
在node_modules目录中找到jquery和bootstrap
将jquery和bootstrap的js文件拷贝到项目目录下pubic的javascripts下
将bootstrap的dist目录下的css目录下的文件拷贝到项目目录下的public的stylesheets目录下
配置使用
因为用的是ejs模板引擎,所以使用方式和html一样,将index.ejs改为如下代码
<!DOCTYPE html><html> <head> <title><%= title %></title> <link rel='stylesheet' href='/stylesheets/style.css' /> <link rel='stylesheet' href='/stylesheets/bootstrap.css' /> <link rel='stylesheet' href='stylesheets/bootstrap-theme.css'> </head> <body> <h1>我是主页</h1> <!-- 标准的按钮 --> <button type="button" class="btn btn-default">默认按钮</button> <!-- 提供额外的视觉效果,标识一组按钮中的原始动作 --> <button type="button" class="btn btn-primary">原始按钮</button> <!-- 表示一个成功的或积极的动作 --> <button type="button" class="btn btn-success">成功按钮</button> <!-- 信息警告消息的上下文按钮 --> <button type="button" class="btn btn-info">信息按钮</button> <!-- 表示应谨慎采取的动作 --> <button type="button" class="btn btn-warning">警告按钮</button> <!-- 表示一个危险的或潜在的负面动作 --> <button type="button" class="btn btn-danger">危险按钮</button> <!-- 并不强调是一个按钮,看起来像一个链接,但同时保持按钮的行为 --> <button type="button" class="btn btn-link">链接按钮</button> </body> <script src="/javascripts/jquery.js"></script> <script src="/javascripts/bootstrap.js"></script></html>
效果
学习资料
bootstrap教程:http://www.runoob.com/bootstrap/bootstrap-tutorial.html
jquery在线api:http://hemin.cn/jq/
0 0
- Node.js学习(三)——Node.js使用Bootstrap
- 【node.js学习】--(6)--Bootstrap
- Node.js学习(一)——Node.js的安装和express初步使用
- Node.js学习笔记(一)—— Node基础
- Node学习课程(1)——安装node.js
- node.js学习笔记(—)
- node.js学习之路(三)
- node.js使用(三):文件操作
- node.js学习笔记1——node.js是什么
- node.js 学习笔记——node.js 环境配置
- Node.js——初识Node.js
- 摸石头——Node.Js(三)
- node.js基础(三)
- node.js学习一(node入门)
- Node.js学习(二)——Node.js连接mysql数据库
- Node.js学习笔记(2)——新建简单的node.js模块
- Node 学习笔记—Node.js 核心 API 之 Util
- Node.JS学习——使用cookie 和 session
- Android学习笔记02:AndroidManifest.xml源码
- 开发STM32相关资料下载
- 怎么在qt中使用connect指令来写socket
- 在logback、log4j等日志输出工具中输出java异常调用堆栈
- 郭霖公众号的文章连接
- Node.js学习(三)——Node.js使用Bootstrap
- mysql数据库主从配置
- HTML+CSS基础 设置top与left让两个div快出现重叠部分
- 200. Number of Islands
- 【OpenCV学习笔记 013】处理视频序列
- Spell checker
- 手机退格键的回调方法:监听用户的点击返回按钮
- Comparable与Comparator的区别
- LA3635-Pie