Bootstrap 4 Tutorial: Create a One-Page Template

• 8 minutes READ

Bootstrap 4 is here and there are plenty of changes and new features.

Today you will learn how easy it is to create a one-page HTML responsive template using Bootstrap 4. At the end of this Bootstrap 4 tutorial, you will understand how to set it up as well as how to use some of the new features in Bootstrap 4.

Startup Bootstrap Builder

In this article, you’ll learn about:

  • Downloading the Bootstrap Files
  • Setting up necessary files
  • Basic mark-up
  • Working with grids
  • Jumbotron
  • Some typography classes
  • Cards
  • Bootstrap 4 enhanced tooltips
  • Table inverse class
  • Basic forms

Also, you can watch the video version of this tutorial on YouTube:

Before begin, make sure to have a code editor such as Sublime text or Notepad++ and some working knowledge of HTML and CSS.

No-Code Email Template Builder

With Postcards Email Builder you can create and edit email templates online without any coding skills! Includes more than 100 components to help you create custom emails templates faster than ever before.

Free Email BuilderFree Email Templates

Looking for a Bootstrap online builder?

Resources you need to complete this tutorial:

Folder Structure

Folder Structure Bootstrap 4

For this tutorial, our folder structure will consist of three folders and one HTML file:

  • html – serve as the main file for all markup
  • img folder – for images
  • css folder – for style sheets (CSS)
  • js folder – for JavaScript

Downloading Bootstrap 4

There are two versions available for download: Bootstrap compiled version and Bootstrap source files.

However, the compiled version is not yet available at the time of writing. You can download the Bootstrap source files here.

Bootstrap 4 Files

Low-Code Website Builders

With Startup App and Slides App you can build unlimited websites using the online website editor which includes ready-made designed and coded elements, templates and themes.

Try Startup App Try Slides AppOther Products

Set Up Necessary Files

For this tutorial, we will focus on picking up the necessary files that we need for our one-page responsive template.

Note: I will create a separate tutorial in the near future on how to set up and use Bootstrap 4 Alpha via SASS.

Once downloaded, unzip the Bootstrap source files and copy the following files inside the dist folder. You can get these files inside the css and js folder upon opening the dist folder.

  • min.css
  • min.js

Dist Folder

In addition, we need to download tether.min.js file or use its CDN version from their website for us to be able to use tooltips in Bootstrap 4 Alpha. Place this file inside the js folder of our project.

Basic Markup

Our HTML document will begin with the HTML5 <!DOCTYPE> to specify which language and version our document is using. Then on our <head> section we can place all of our CSS, JavaScripts and fonts/images links. For performance purposes, you may wish to place the JavaScript files at the bottom of the document (just before the closing </body> tag).

&lt;!-- DOCTYPE --&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;title&gt;Boostrap 4 - Tutorial&lt;/title&gt;
&lt;!-- Required meta tags always come first --&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;meta name=&quot;author&quot; content=&quot;Sam Norton&quot;&gt;
&lt;!-- Bootstrap CSS --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/bootstrap.min.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/custom.css&quot;&gt;
&lt;!-- Fonts --&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Lato:400,700,900,300' rel='stylesheet' type='text/css'&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Raleway:400,300,600,700,900' rel='stylesheet' type='text/css'&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css&quot;&gt;
&lt;/head&gt;

We may also add the following code to force Internet Explorer to render to its rendering mode and the meta viewport property for responsive view.

&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
&lt;meta http-equiv=&quot;x-ua-compatible&quot; content=&quot;ie=edge&quot;&gt;

To start, we will use the template below as our starting HTML for our one-page responsive template. Notice that I’ve added some hosted library links such as Font Awesome and Google Fonts.

&lt;!-- DOCTYPE --&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;title&gt;Boostrap 4 - Tutorial&lt;/title&gt;
&lt;!-- Required meta tags always come first --&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;meta name=&quot;author&quot; content=&quot;Sam Norton&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
&lt;meta http-equiv=&quot;x-ua-compatible&quot; content=&quot;ie=edge&quot;&gt;
&lt;!-- Bootstrap CSS --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/bootstrap.min.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/custom.css&quot;&gt;
&lt;!-- Fonts --&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Lato:400,700,900,300' rel='stylesheet' type='text/css'&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'&gt;
&lt;link href='https://fonts.googleapis.com/css?family=Raleway:400,300,600,700,900' rel='stylesheet' type='text/css'&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!---CONTENT HERE--&gt;
&lt;!-- JavaScripts --&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/tether.min.js&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

Working with Grids

The Bootstrap 4 grid system can have 12 columns and you can choose which column scale you want to display on different viewport sizes. Check out the Bootstrap 4 medium grid below with classes.

Bootstrap 4 grid system

We will not be talking much about the grid system in depth in this tutorial, however we will go straight on the column scale that we’re going to use on our one-page template.

Let’s first wrap everything inside a div wrapper class and then divide each part of our documents via section tag and place classes specifically for each.

&lt;!--wrapper start--&gt;
&lt;div class=&quot;wrapper&quot; id=&quot;wrapper&quot;&gt;
&lt;!--header section--&gt;
&lt;header&gt;
&lt;/header&gt;
&lt;!--about us section--&gt;
&lt;section class=&quot;aboutus&quot; id=&quot;aboutus&quot;&gt;
&lt;/section&gt;
&lt;!--features section--&gt;
&lt;section class=&quot;features&quot; id=&quot;features&quot;&gt;
&lt;/section&gt;
&lt;!--contact us section--&gt;
&lt;section class=&quot;contact&quot; id=&quot;contact&quot;&gt;
&lt;/section&gt;
&lt;!--footer section--&gt;
&lt;section class=&quot;footer&quot; id=&quot;footer&quot;&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/div&gt;
&lt;!--wrapper end--&gt;

Next, we will add the bootstrap’s container class to wrap elements and contain its grid system. We will be using a fixed container. This means that as the viewport changes, its width remains intact until it meets certain breakpoints.

Note that we will not put a container div on the header section as we want it to expand all throughout the browser size. Let’s do that now.

&lt;!--wrapper start--&gt;
&lt;div class=&quot;wrapper&quot; id=&quot;wrapper&quot;&gt;
&lt;!--header section--&gt;
&lt;header&gt;
&lt;/header&gt;
&lt;!--about us section--&gt;
&lt;section class=&quot;aboutus&quot; id=&quot;aboutus&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--features section--&gt;
&lt;section class=&quot;features&quot; id=&quot;features&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--contact us section--&gt;
&lt;section class=&quot;contact&quot; id=&quot;contact&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--footer section--&gt;
&lt;section class=&quot;footer&quot; id=&quot;footer&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/div&gt;
&lt;!--wrapper end--&gt;

To continue, we need to add rows and columns inside container divs. The basic purpose of rows is to wrap up column while column contains the content. Let’s start adding rows and columns with some additional classes. Do not worry about these classes, we will talk more about them later.

&lt;!--wrapper start--&gt;
&lt;div class=&quot;wrapper&quot; id=&quot;wrapper&quot;&gt;
&lt;!--header section--&gt;
&lt;header&gt;
&lt;/header&gt;
&lt;!--about us section--&gt;
&lt;section class=&quot;aboutus&quot; id=&quot;aboutus&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-lg-12&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--features section--&gt;
&lt;section class=&quot;features&quot; id=&quot;features&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-6&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-6&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--contact us section--&gt;
&lt;section class=&quot;contact&quot; id=&quot;contact&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-lg-12&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!--footer section--&gt;
&lt;section class=&quot;footer&quot; id=&quot;footer&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-lg-12&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/div&gt;
&lt;!--wrapper end--&gt;

Using Jumbotron

Jumbotron draws marketing messages and calls to action. Bootstrap Jumbotron (formerly hero unit) is a large banner like section with large text, light gray background wrap with box that has a border radius in it.

To create a Jumbotron, you need to add the jumbotron class to a div element and then add header tags to it. On our template, we’re going to use jumbotron class but we’ll customize how it looks. To make it a more modern template, we’re going to use jumbotron to create a parallax displacement effect. Add the code below inside the header section.

Note: We’ve also added a jumbotron-fluid class to make it fluidly responsive.

&lt;!--header section--&gt;
&lt;header&gt;
&lt;div class=&quot;jumbotron jumbotron-fluid&quot; id=&quot;banner&quot;&gt;		
&lt;div class=&quot;parallax text-center&quot; style=&quot;background-image: url(img/cover.jpg);&quot;&gt;
&lt;div class=&quot;parallax-pattern-overlay&quot;&gt;
&lt;div class=&quot;container text-center&quot; style=&quot;height:580px;padding-top:170px;&quot;&gt;
&lt;a href=&quot;#&quot;&gt;&lt;img id=&quot;site-title&quot; src=&quot;img/logo.png&quot; alt=&quot;logo&quot;/&gt;&lt;/a&gt;
&lt;h2 class=&quot;display-2&quot;&gt;Boostrap 4 Alpha is here!&lt;/h2&gt;
&lt;h3 class=&quot;learn&quot;&gt;Wanna know how to use it?&lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/header&gt;

Basic Typography Classes

Bootstrap has special classes for displaying headings that designed to stand out more than the normal headings. Basically, there are four size/class display headings:

  • display-1
  • display-2
  • display-3
  • display-4

A larger number means bigger text size. In our example above (header section), we’ve used display-2 inside the h2 tag these will render the text on second size level.

Now, let’s add the following code to our About Us section:

&lt;div class=&quot;heading text-center&quot;&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h2&gt;About Boostrap 4 Alpha&lt;/h2&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h3&gt;&lt;mark&gt;Bootstrap&lt;/mark&gt; is the world’s most popular framework for building responsive, mobile-first sites and applications. Inside you’ll find high quality HTML, CSS, and JavaScript to make starting any project easier than ever. On &lt;mark&gt;August 19&lt;/mark&gt;, Bootstrap 4 alpha was released with the removal of support for IE8. Of course, there are still going to be a couple of alphas before they move to the beta phase, but this gives us a glimpse on what to expect on the next versions.&lt;/h3&gt;
&lt;/div&gt;

There’s nothing special in this code; I just added a div with classes along with images and header tags inside but notice the <mark> tag. This is an HTML5 element to represents text as marked or highlighted to emphasize a word or a sentence. Basically Bootstrap also has its own rendering on this element. See the image below.

Basic Bootstrap

We will discuss typography classes more in a separate article.

Creating Cards

Cards are new components in Boostrap 4 Alpha. Cards work as a container with light styles in replaced with wells, panels and thumbnails. It supports a variety of style options such as alignment, colors, headings and more.

To create a card, simply add the card and card-block classes to a div. For its title add card-title class and card-text for its regular text.

Copy and paste and paste the code below to your markup inside the About Us section.

&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;div class=&quot;card&quot;&gt;
&lt;img class=&quot;card-img-top&quot; src=&quot;img/card1.jpg&quot; alt=&quot;Card image cap&quot;&gt;
&lt;div class=&quot;card-block&quot;&gt;
&lt;h4 class=&quot;card-title&quot;&gt;This is Card #1&lt;/h4&gt;
Some quick example text to build on the card title and make up the bulk of the card's content.
&lt;a href=&quot;https://v4-alpha.getbootstrap.com/components/card/&quot; class=&quot;btn btn-primary&quot;&gt;Learn More&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;div class=&quot;card card-inverse card-primary text-center&quot;&gt;
&lt;img class=&quot;card-img-top&quot; src=&quot;img/card2.jpg&quot; alt=&quot;Card image cap&quot;&gt;
&lt;div class=&quot;card-block&quot;&gt;
&lt;h4 class=&quot;card-title&quot;&gt;This is Card #2&lt;/h4&gt;
Some quick example text to build on the card title and make up the bulk of the card's content.
&lt;a href=&quot;https://v4-alpha.getbootstrap.com/components/card/&quot; class=&quot;btn btn-primary&quot;&gt;Learn More&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;div class=&quot;card card-inverse card-success text-center&quot;&gt;
&lt;img class=&quot;card-img-top&quot; src=&quot;img/card3.jpg&quot; alt=&quot;Card image cap&quot;&gt;
&lt;div class=&quot;card-block&quot;&gt;
&lt;h4 class=&quot;card-title&quot;&gt;This is Card #3&lt;/h4&gt;
Some quick example text to build on the card title and make up the bulk of the card's content.
&lt;a href=&quot;https://v4-alpha.getbootstrap.com/components/card/&quot; class=&quot;btn btn-primary&quot;&gt;Learn More&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-3&quot;&gt;
&lt;div class=&quot;card card-inverse card-info text-center&quot;&gt;
&lt;img class=&quot;card-img-top&quot; src=&quot;img/card4.jpg&quot; alt=&quot;Card image cap&quot;&gt;
&lt;div class=&quot;card-block&quot;&gt;
&lt;h4 class=&quot;card-title&quot;&gt;This is Card #4&lt;/h4&gt;
Some quick example text to build on the card title and make up the bulk of the card's content.
&lt;a href=&quot;https://v4-alpha.getbootstrap.com/components/card/&quot; class=&quot;btn btn-primary&quot;&gt;Learn More&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

Adding Tooltips

Bootstrap 4 Alpha requires a third-party library called tether to enable tooltips. To use tooltips simply include tether.min.js just before the bootstrap.js file.

To use tooltip via tether simply create a link the attribute data-toggle=”tooltip” and then include your text tooltip inside the title attribute. Check out the sample code below.

&lt;a href=&quot;#&quot; data-toggle=&quot;tooltip&quot; title=&quot;This is a tooltip&quot;&gt;Bootstrap 4 alpha&lt;/a&gt;

On the example above we’ve used anchor tags but tooltips is not limited only on this. You can also use it inside buttons and divs. To initialize all tooltips on a page you need to add a JavaScript code below the tether.min.js source link to select tooltips by their data-toggle attribute.

You can simply use the following code.

&lt;script type=&quot;text/javascript&quot;&gt;
$(function () {
  $('[data-toggle=&quot;tooltip&quot;]').tooltip()
})	
&lt;/script&gt;

Let’s see it in action in our features section. Copy and paste the code below inside the col-lg-12 class.

&lt;div class=&quot;heading text-center&quot;&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h2&gt;Enhanced Features&lt;/h2&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h3&gt;&lt;a href=&quot;#&quot; data-toggle=&quot;tooltip&quot; title=&quot;This is a tooltip&quot;&gt;Bootstrap 4 alpha&lt;/a&gt; has a new prefix &lt;a href=&quot;#&quot; data-toggle=&quot;tooltip&quot; title=&quot;Make all backgrounds black!&quot;&gt;–inverse&lt;/a&gt; class that gives a background to the table itself. Another cool thing about this is the improve tooltips and popovers which help a lot of developers when it comes to ease of use. Thanks to &lt;a href=&quot;#&quot; data-toggle=&quot;tooltip&quot; title=&quot;Tether is a JavaScript library for efficiently making an absolutely positioned element stay next to another element on the page. For example, you might want a tooltip or dialog to open, and remain, next to the relevant item on the page.&quot;&gt;Tether&lt;/a&gt; , a third party library it has improved. &lt;/h3&gt;
&lt;/div&gt;

Table Class Prefix “Inverse”

Bootstrap 4 Alpha has added a new prefix –inverse class that inverts the color of the table itself.

Add the class table-inverse to enable this feature.

Let’s see in action. Copy the code below inside the features section right after the code above.

&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-md-6&quot;&gt;
&lt;table class=&quot;table table-inverse&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th colspan=&quot;3&quot; class=&quot;text-center&quot;&gt;Bootstrap 3&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Device&lt;/th&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Extra Small&lt;/td&gt;
&lt;td&gt;Less than 768px&lt;/td&gt;
&lt;td&gt;col-xs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small&lt;/td&gt;
&lt;td&gt;768px and up&lt;/td&gt;
&lt;td&gt;col-sm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;992px and up&lt;/td&gt;
&lt;td&gt;col-md&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large&lt;/td&gt;
&lt;td&gt;1200px and up&lt;/td&gt;
&lt;td&gt;col-lg&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-6&quot;&gt;
&lt;table class=&quot;table table-inverse&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th colspan=&quot;3&quot; class=&quot;text-center&quot;&gt;Bootstrap 4&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Device&lt;/th&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Extra Small&lt;/td&gt;
&lt;td&gt;Less than 34em&lt;/td&gt;
&lt;td&gt;col-xs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small&lt;/td&gt;
&lt;td&gt;34em and up&lt;/td&gt;
&lt;td&gt;col-sm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;48em and up&lt;/td&gt;
&lt;td&gt;col-md&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large&lt;/td&gt;
&lt;td&gt;62em and up&lt;/td&gt;
&lt;td&gt;col-lg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extra Large&lt;/td&gt;
&lt;td&gt;75em and up&lt;/td&gt;
&lt;td&gt;col-xl&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;

As you can see there is nothing special here just a regular table but Bootstrap 4 will handle the styles. See the image below.

Bootstrap 4 Devices

Bootstrap 4 Forms

Bootstrap 4 Forms are responsive that stacked vertically on viewports by default using the display: block and width: 100% styles. These gives the user a better look on all viewports, but can still be customized.

To use Bootstrap’s Form, simply add the form-control class on all of the field sets such as input, text-area and so on. You also need to add <fieldset> tag along with the form-group class inside it.

Let’s see this in action. Replace the code you’ve set on the contact us section with the code below.

&lt;!--Contact Us--&gt;
&lt;section class=&quot;contact&quot; id=&quot;contact&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-lg-12&quot;&gt;
&lt;div class=&quot;heading&quot;&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h2&gt;Contact Us&lt;/h2&gt;
&lt;img class=&quot;dividerline&quot; src=&quot;img/sep.png&quot; alt=&quot;&quot;&gt;
&lt;h3&gt;Feel free to reach out for any questions!
&lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;container mx-width&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;done&quot;&gt;
&lt;div class=&quot;alert alert-success&quot;&gt;
&lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;alert&quot;&gt;×&lt;/button&gt;
Your message has been sent. Thank you!
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-md-12&quot;&gt;
&lt;form&gt;
&lt;fieldset class=&quot;form-group&quot;&gt;
&lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;Name&quot; placeholder=&quot;Name&quot;&gt;
&lt;/fieldset&gt;
&lt;fieldset class=&quot;form-group&quot;&gt;
&lt;input type=&quot;email&quot; class=&quot;form-control&quot; id=&quot;Email&quot; placeholder=&quot;Email&quot;&gt;
&lt;/fieldset&gt;
&lt;fieldset class=&quot;form-group&quot;&gt;
&lt;textarea class=&quot;form-control&quot; rows=&quot;3&quot; placeholder=&quot;Message&quot;&gt;&lt;/textarea&gt;
&lt;/fieldset&gt;
&lt;button type=&quot;submit&quot; class=&quot;contact submit&quot;&gt;Submit&lt;/button&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;

Notice that I’ve also added some support class alert-success to notify the user that the form was successfully submitted.

Footer and Icons

Bootstrap 3 offers a dozen reusable glyphicons components which can be used for different purposes. For Bootstrap 4 Alpha this feature was dropped. For our footer section we’re going to include Font-Awesome (https://fortawesome.github.io/Font-Awesome/ ) icon classes for our social media icons. Copy the code below in your footer section.

&lt;ul&gt;	
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;fa fa-facebook&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;fa fa-twitter&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;fa fa-linkedin&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;fa fa-pinterest&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
© 2015 - Designmodo.com

With all of the code we’ve written so far, you will have exactly the same output as the image below.

Bootstrap 4 Template

Customizing Styles

Now that we have everything set up on our HTML, we need to customize our styles to make our one- page template look awesome. Open up the custom.css and add the general styles below for our basic elements and classes.

body {
    font-family:'Lato', sans-serif;
    font-size:1em;
    color:#777;
    font-weight:300;
    line-height:1.7;
    overflow-x:hidden;
}

h1,h2,h3,h4,h5,h6 {
    color:#333;
    line-height:1.4;
    font-weight:700;
}

.mx-width {
    max-width:960px;
    margin:0 auto;
}

a,a:hover {
    color:#563d7c;
    text-decoration:none;
}

img{
  width:100%;
  max-width: 100%;
  height:auto;
}

.card-img-top{
  width:100%;
  height:auto;
}

header {
    padding-bottom:50px;
}

.display-2 {
    font-family:'Lato';
    font-size:60px;
    line-height:1;
    font-weight:300;
    color:#fff
}

.learn {
    font-family:'Lato';
    font-size:27px;
    line-height:1.4;
    font-weight:300;
    color:#fff;
}

.jumbotron-fluid {
    padding:0;
}

Next, we will set up some styles for our parallax effect via parallax and parallax-pattern-overlay class.

.parallax {
    text-align:center;
    background-position:center center;
    background-repeat:no-repeat;
    background-size:cover;
    background-attachment:fixed!important;
    overflow:hidden;
}

.parallax-pattern-overlay {
    background-image:url(../img/pattern.png);
    background-repeat:repeat;
}

For our heading class we need to set up a specific maximum width of 960px and then give each header tags some font-size and some more styles to emphasize each.

.heading {
    padding-bottom:15px;
    text-align:center;
    max-width:960px;
    margin:0 auto;
    padding-top:80px;
}

.heading h2 {
    font-weight:600;
    font-family:'Raleway';
    font-size:40px;
    color:#333;
    margin:0;
    padding:5px;
}

.heading h3 {
    font-size:1em;
    line-height:1.7;
}

#site-title {
    max-width:150px;
}

Next, let’s add some styles to our forms. The Bootstrap default forms will have a normal amount of padding and a nice border radius but for our one-page responsive template we’re going to apply a flat design concept. Copy and paste the styles below.

input.form-control {
    background:#fff;
    border:solid 1px #ddd;
    color:#000;
    padding:15px 30px;
    margin-right:3%;
    margin-bottom:30px;
    outline:none;
    border-radius: 0;
}

textarea.form-control {
    background:#fff;
    color:#000;
    border:solid 1px #ddd;
    padding:15px 30px;
    margin-bottom:40px;
    outline:none;
    height:200px;
    border-radius: 0;
}

button.contact.submit {
    background:#333;
    font-family:'Lato',sans-serif;
    color:#fff;
    font-size:1em;
    font-weight:400;
    text-align:center;
    margin:0;
    border:none!important;
    border-radius:3px;
    padding:15px 45px;
}

button.contact.submit:hover {
    background:#563d7c;
}

.form-control:focus{
    border-color: #563d7c;
    outline: 0;
}

.done {
    display:none;
}

Afterward, let’s add styles to the footer. We will set up a nice background color light violet and give some styles for our footer text and icons. Nothing special here.

.footer {
    background:#563d7c;
    margin-top:120px;
    position:relative
}

.footer .container {
    padding:60px 0 20px;
}

.footer ul {
    margin:0 auto;
    margin-bottom:30px;
    margin-top:10px;
    text-align:center;
    list-style-type:none;
    padding-left:0;
}

.footer ul li {
	text-align:center;
    display:inline-block;
    background:rgba(0,0,0,0.2);
    color:#fff;
    line-height:45px;
    margin:0 4px;
    width:45px!important;
    height:45px!important;
    -webkit-border-radius:3px;
    border-radius:3px;
}

.footer ul li:hover {
    background:#2a2a2a;
}

.footer ul li:hover	a {
    color:#fff;
}

.footer ul li a {
    color:#fff;
    width:42px!important;
    height:42px!important;
}

.footer ul li a i {
    line-height:45px;
    color:#fff;
}

.footer p {
    color:#fff;
    font-size:.9em;
    line-height:24px;
    font-weight:300;
    text-align:center;
    text-transform:uppercase;
}

.footer a,.footer a:hover {
    color:#fff;
}

As a final touch, customize some elements on 768px viewport via media queries specifically with some of our columns sizes to make it look good on this screen size.

@media screen and (max-width:768px) {

input.contact.col-md-6{
    width:40.5%;
    margin: 15px 15px 0 58px;
}

textarea.contact.col-md-12 {
     margin: 15px 15px 0 58px;
}

button#submit.contact.submit{
    margin: 15px 15px 0 42px;
}

} 

Conclusion

There you have it! Feel free to customize the design or the code that we set up above.

Remember that at the time of this article, the first alpha version of Bootstrap 4 was just released — that means there might be few alpha series in the near future so it’s good to check out their official website once in a while.

If you want to learn more about Bootstrap 4, you can always refer to the documentation here.

Check out and download to see the Bootstrap 4 template in action.

Did you learn a lot on this tutorial? Leave a comment below and let us know what you think.

Sam Norton

Sam is an expert Full Stack Developer who loves making digital solutions that are meaningful and new. Sam is an expert in web design and development. He uses his knowledge of HTML/CSS, JavaScript, jQuery, Ruby, Ruby on Rails, WordPress, Node.js, React, Express.js, Gatsby.js, GraphQL, and Strapi.js to make custom websites that reflect clients' unique brands and serve their business niches. Committed to staying ahead of the curve, Sam harnesses the power of the latest technologies, CMS, and platforms to build cutting-edge websites that outperform competitors.

Posts by Sam Norton
🍪

We use cookies to ensure that we give you the best experience on our website. Privacy Statement.

  • I disagree
  • I agree