- Bootstrap 4 Cookbook
- Ajdin Imsirovic
- 203字
- 2021-07-02 21:08:03
How to do it...
- 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.
- Add another line to index.ejs, and reference another include:
<%- partial("partial/_chapter2-5-html") %>
- 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;}
- 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
- 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>
- 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.
推薦閱讀
- Mastering NetBeans
- Git Version Control Cookbook
- arc42 by Example
- Java Web基礎與實例教程(第2版·微課版)
- Java技術手冊(原書第7版)
- FLL+WRO樂高機器人競賽教程:機械、巡線與PID
- Unreal Engine 4 Shaders and Effects Cookbook
- Jenkins Continuous Integration Cookbook(Second Edition)
- Unity UI Cookbook
- Building Dynamics CRM 2015 Dashboards with Power BI
- Java程序設計實用教程(第2版)
- 零基礎學編程系列(全5冊)
- Puppet Cookbook(Third Edition)
- Serverless從入門到進階:架構、原理與實踐
- Microsoft Azure Security