Reader small image

You're reading from  Bootstrap 4 Cookbook

Product typeBook
Published inJun 2017
Reading LevelBeginner
PublisherPackt
ISBN-139781785889295
Edition1st Edition
Languages
Right arrow
Author (1)
Ajdin Imsirovic
Ajdin Imsirovic
author image
Ajdin Imsirovic

Ajdin Imsirovic is a full-stack web developer who has published several courses on the subject of web design and web development. He has also authored three books, Bootstrap 4 Cookbook, Elm Web Development, and Vue.js Quick Start Guide. In his fourth book, Vue CLI 3 Quick Start Guide, he introduces readers to the rich ecosystem of frontend tooling and best practices.
Read more about Ajdin Imsirovic

Right arrow

Easily positioning inline forms


In this recipe, we will position an inline form in the center of the viewport, on the left, and on the right. To achieve that, we will be using flexbox classes of justify-content-center, justify-content-start, and justify-content-end.

Getting ready

To get acquainted with how forms work, navigate to the forms component section of the Bootstrap documentation at https://v4-alpha.getbootstrap.com/components/forms/.

How to do it…

  1. Open the currently empty file located at chapter4/start/app/recipe04-09.ejs, and add the following code:
<div class="container-fluid">

 <div class="mt-5">
 <h1><%- title %></h1>
 <p><a href="https://v4-alpha.getbootstrap.com/components/forms/" 
   target="_blank">Link to bootstrap forms docs</a></p>
 </div>

</div><!-- /.container --> 
  1. In the same file, add the following code to the bottom to position the first form in the center:
<div class="container-fluid mt-5">...
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Bootstrap 4 Cookbook
Published in: Jun 2017Publisher: PacktISBN-13: 9781785889295

Author (1)

author image
Ajdin Imsirovic

Ajdin Imsirovic is a full-stack web developer who has published several courses on the subject of web design and web development. He has also authored three books, Bootstrap 4 Cookbook, Elm Web Development, and Vue.js Quick Start Guide. In his fourth book, Vue CLI 3 Quick Start Guide, he introduces readers to the rich ecosystem of frontend tooling and best practices.
Read more about Ajdin Imsirovic