Using bootstrap
Using the Chinese network CDN Source Load Bootstrap: Modify F:\nodejs\nodejs-bower\views\index.ejs
<! DOCTYPE html>
<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 '/>
<body>
<div class= "Well Jumbotron" >
<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>
Operating effect:
We divide the Index.ejs page into 3 parts: Header.ejs, Index.ejs, Footer.ejs, which are used for the modularization of Web pages.
views/
├──error.ejs
├──footer.ejs
├──header.ejs
└──index.ejs
Header.ejs
<! DOCTYPE html>
<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 '/>
<body>
Footer.ejs
<! DOCTYPE html>
<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 '/>
<body>
Index.ejs
<% include Header.ejs%>
<div class= "Welljumbotron" >
<p>this is a simple hero unit, Asimple Jumbotron-style component for calling extra attention to featuredcontent or I Nformation.</p>
<p><a class= "btn btn-primarybtn-lg" href= "#" role= "button" >Learnmore</a></p>
</div>
<% include Footer.ejs%>
Run the same effect (slightly)
Reference http://blog.fens.me/nodejs-express4/
"Node. JS Learning"--(6)--bootstrap