"Node. JS Learning"--(6)--bootstrap

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.