官术网_书友最值得收藏!

How to do it...

  1. In workspace/app/index.ejs, at the bottom of the file, let's comment out the EJS code. The current code looks like this:
      <%- partial("partial/_defaultGrid") %>

We will comment it out by replacing the third character from - to #:

      <%# partial("partial/_defaultGrid") %>

If you save your index.ejs file now (and if the harp server command is running), when you refresh your Cloud9 users page, the grid that is called by the _defaultGrid partial will be gone.

  1. Add another line to index.ejs, and reference another include:
      <%- partial("partial/_chapter2-5-html") %>
  1. In main-02-05.scss, add the following code:
      // Recipe 2-5
$enable-rounded: false;
$white: whitesmoke;
$border-width: 1px;
$font-size-base: 1rem;

@import "./bower_components/bootstrap/scss/bootstrap.scss";

$grid-columns: 5;
$grid-gutter-width-base: 0;
.img-fluid {margin: 0;}
  1. In app/partial, create the _chapter2-5-html.ejs partial, and c9 into it:
      cd && cd workspace/app/partial && touch _chapter2-5.ejs && c9  
_chapter2-5.ejs
  1. Add the following code to the file:
      <div class="container-fluid">
<div class="row">
<div class="col-md-1">
<img class="img-fluid"
src="http://placehold.it/767x767/613d7c/ffffff?text=COL-MD-1">
</div>
<div class="col-md-1">
<img class="img-fluid"
src="http://placehold.it/767x767/5bc0de/ffffff?text=COL-MD-1">
</div>
<div class="col-md-1">
<img class="img-fluid"
src="http://placehold.it/767x767/0275d8/ffffff?text=COL-MD-1">
</div>
<div class="col-md-1">
<img class="img-fluid"
src="http://placehold.it/767x767/f0ad4e/ffffff?text=COL-MD-1">
</div>
<div class="col-md-1">
<img class="img-fluid"
src="http://placehold.it/767x767/d9534f/ffffff?text=COL-MD-1">
</div>
</div>
</div>
  1. Save the changes and preview them in your web page.
In the two previous recipes, Splitting up our Harp project into partials and  Using containers with margin and padding utility classes, we have set up our Bootstrap 4 workflow so that we can easily turn on and off multiple style sheets and HTML includes, which will significantly cut down our development time and help us stay organized.
主站蜘蛛池模板: 大城县| 南漳县| 平阴县| 本溪市| 贵阳市| 应用必备| 柳江县| 鱼台县| 永靖县| 毕节市| 崇文区| 卢氏县| 仲巴县| 贡嘎县| 东乌珠穆沁旗| 兴城市| 团风县| 石阡县| 凤凰县| 汉川市| 宜城市| 阜阳市| 临邑县| 东山县| 虞城县| 麻阳| 西藏| 香港 | 灌云县| 西宁市| 渝中区| 兖州市| 道真| 东莞市| 武城县| 长丰县| 红原县| 穆棱市| 雅安市| 连江县| 绥芬河市|