【node.js学习】--(6)--Bootstrap
来源:互联网 发布:数据挖掘在的应用 编辑:程序博客网 时间:2024/06/06 03:15
使用Bootstrap
使用中文网的CDN源加载bootstrap :修改F:\nodejs\nodejs-bower\views\index.ejs
<!DOCTYPE html><html lang="zh-CN"> <head> <title><%= title %></title> <link rel="stylesheet"href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css"> <link rel='stylesheet' href='/stylesheets/style.css' /> </head> <body> <div class="well jumbotron"> <h1><%= title %></h1> <p>This is a simple hero unit, a simple jumbotron-style componentfor calling extra attention to featured content or information.</p> <p><a class="btn btn-primary btn-lg"href="#" role="button">Learn more</a></p> </div> <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script> <scriptsrc="http://cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> </body></html>
运行效果:
我们把index.ejs页面切分成3个部分:header.ejs, index.ejs, footer.ejs,用于网站页面的模块化。
views/├──error.ejs├──footer.ejs├──header.ejs└──index.ejs
header.ejs
<!DOCTYPE html><html lang="zh-CN"> <head> <title><%= title %></title> <link rel="stylesheet"href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css"> <link rel='stylesheet' href='/stylesheets/style.css' /> </head> <body>
footer.ejs
<!DOCTYPE html><html lang="zh-CN"> <head> <title><%= title %></title> <link rel="stylesheet"href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css"> <link rel='stylesheet' href='/stylesheets/style.css' /> </head> <body>
index.ejs
<% include header.ejs %> <div class="welljumbotron"><h1><%= title %></h1><p>This is a simple hero unit, asimple jumbotron-style component for calling extra attention to featuredcontent or information.</p><p><a class="btn btn-primarybtn-lg" href="#" role="button">Learnmore</a></p></div> <% include footer.ejs %>
运行效果一样(略)
参考http://blog.fens.me/nodejs-express4/
2 0
- 【node.js学习】--(6)--Bootstrap
- Node.js学习(三)——Node.js使用Bootstrap
- Node.js学习(6)----事件
- node.js、git、bootstrap等安装配置
- bootstrap-datetimepicker.js学习
- 学习 Node.js 的 6 个步骤
- 学习 Node.js 的 6 个步骤
- 学习 Node.js 的 6 个步骤
- node.js入门学习
- node.js进阶学习
- Node.JS学习笔记
- Node.js 学习随笔
- Node.js 学习1
- Node.js学习历程
- node.js入门学习
- node.js进阶学习
- Node.js学习
- Node.js简单学习
- struts2工作原理
- redis windows下的环境搭建
- Windows环境下NodeJs的Oracle数据库驱动node-oracledb的安装
- 0009 嘿嘿
- [人眼检测] high confidence visual recognition of persons by a test of statistical independence
- 【node.js学习】--(6)--Bootstrap
- POJ 2492--A Bug's Life 【并查集,向量偏移】
- UVa 589 - Pushing Boxes
- CodeForces 509B Painting Pebbles
- 计算机网络第五章
- HDU 2151--Worm【动态规划】
- uva 10375 选择与除法
- 直接序列扩频通信(DSSS)
- spring中依赖注入方式总结