BS Theme "The Band"
Create a Theme: "The Band"
You will learn how to create a Bootstrap theme from scratch on this page.
Our plan is to commence with a basic HTML page and gradually incorporate additional elements until we have a fully functional, customized, and mobile-friendly website.
The output will look like this, and you can edit, save, distribute, utilize, or do anything else you want with it:
-----example mukavu -----
HTML Start Page
We will start with the following HTML page:
Bootstrap Theme The Band
THE BAND
We love music!
We have created a fictional band website. Lorem ipsum..
Add Bootstrap CDN and Put Elements in Container
Include the Bootstrap CDN, a jQuery link, and HTML components included in a container (.container):
Example
Bootstrap Theme The Band
THE BAND
We love music!
We have created a fictional band website. Lorem ipsum..
Result:
THE BAND
We love music!
We have created a fictional band website. Lorem ipsum..
Center Text
To center the text inside the container, apply the .text-center class. To make the “We love music” text italic, use the <em> element:
Example
THE BAND
We love music!
We have created a fictional band website. Lorem ipsum..
Result:
-----example mukavu -----
Add Padding
To add padding to the container and make it seem nice, use CSS:
Example
.container {
padding: 80px 120px;
}
Result:
-----example mukavu -----
Add a Grid
Construct three columns with the same width (.col-sm-4), then insert the text and images into the container:
Example
THE BAND
We love music!
We have created a fictional band website. Lorem ipsum..
Name
Name
Name
Result:
-----example mukavu -----
Style The Carousel
The carousel can be styled with CSS:
Example
.carousel-inner img {
-webkit-filter: grayscale(90%);
filter: grayscale(90%); /* make all photos black and white */
width: 100%; /* Set width to 100% */
margin: auto;
}
.carousel-caption h3 {
color: #fff !important;
}
@media (max-width: 600px) {
.carousel-caption {
display: none; /* Hide the carousel text when the screen is less than 600 pixels wide */
}
}
Result:
-----example mukavu -----
Add Tour Container
Create a new container and fill it with a list (.list-group and .list-group-item).
Give the container a custom class (.bg-1) with a black background and give its offspring the following styles:
Example
TOUR DATES
Lorem ipsum we'll play you some music.
Remember to book your tickets!
- September Sold Out!
- October Sold Out!
- November 3
Result:
-----example mukavu -----
Add Labels & Badges
Use a label (.label) and a badge (.badge) to indicate which tickets are still available or sold out:
Example
- September Sold Out!
- October Sold Out!
- November 3
Result:
-----example mukavu -----
Add Thumbnail Images
Add three equal-width columns (.col-sm-4) to the Tour container:
Include an image in each column.
Next, resize the image to a thumbnail using the .img-thumbnail class.
Normally, the <img> element would already have the .img-thumbnail class added to it. To define an image text as well, we have positioned a thumbnail container around the image in this example.
Example
Paris
Fri. 27 November 2015
New York
Sat. 28 November 2015
San Francisco
Sun. 29 November 2015
Result:
-----example mukavu -----
Style Lists, Thumbnails & Buttons
To style the thumbnail photos and the list, use CSS. In this instance, we have eliminated the rounded borders from the list and attempted to make the thumbnail photos resemble cards by eliminating their borders and setting each image’s width to 100%.
Additionally, we changed the Bootstrap .btn class’s default styles to a black button:
Example
/* Remove rounded borders from list */
.list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.list-group-item:last-child {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
/* Remove border and add padding to thumbnails */
.thumbnail {
padding: 0 0 15px 0;
border: none;
border-radius: 0;
}
.thumbnail p {
margin-top: 15px;
color: #555;
}
/* Black buttons with extra padding and without rounded borders */
.btn {
padding: 10px 20px;
background-color: #333;
color: #f1f1f1;
border-radius: 0;
transition: .2s;
}
/* On hover, the color of .btn will transition to white with black text */
.btn:hover, .btn:focus {
border: 1px solid #333;
background-color: #fff;
color: #000;
}
Result:
-----example mukavu -----
Add a Modal
First, change all buttons inside the thumbnail from <button class=”btn”> Buy Tickets </button> to <button class=”btn” data-toggle=”modal” data-target=”#myModal” > Buy Tickets </button>. These buttons are used to open the actual modal.
Examine the code below to build the modal:
Example
Result (click on the “Buy Tickets” button to see the effect):
-----example mukavu -----
Add Contact Container
Make a new container called .col-md-4 and .col-md-8, with two unequally wide columns.
Put form controls in the second column and informative icons with text inside the first:
Example
Contact
We love our fans!
Fan? Drop a note.
Chicago, US
Phone: +00 1515151515
Email: mail@mail.com
Result:
-----example mukavu -----
Add Toggable Tabs
Include tabs (.nav nav-tabs) with “quotes” from the band members inside the contact container:
Example
From The Blog
Mike Ross, Manager
Man, we've been on the road for some time now. Looking forward to lorem ipsum.
Chandler Bing, Guitarist
Always a pleasure people! Hope you enjoyed it as much as I did. Could I BE.. any more pleased?
Peter Griffin, Bass player
I mean, sometimes I enjoy the show, but other times I enjoy other things.
Result:
-----example mukavu -----
Add Map/Location Image
Add a map or an image of the site.
Example
Result:
-----example mukavu -----
Add a Navbar
Include a collapsible navigation bar at the top of the page for smaller screens:
Example
Result:
-----example mukavu -----
A helpful hint is to use the navbar-right class to align the navigation links to the right.
Use the .dropdown class on a link in the navbar to make it function as a dropdown menu.
Style The Navbar
Use CSS to alter the navigation bar:
Example
/* Add a dark background color with a little bit see-through */
.navbar {
margin-bottom: 0;
background-color: #2d2d30;
border: 0;
font-size: 11px !important;
letter-spacing: 4px;
opacity: 0.9;
}
/* Add a gray color to all navbar links */
.navbar li a, .navbar .navbar-brand {
color: #d5d5d5 !important;
}
/* On hover, the links will turn white */
.navbar-nav li a:hover {
color: #fff !important;
}
/* The active link */
.navbar-nav li.active a {
color: #fff !important;
background-color:#29292c !important;
}
/* Remove border color from the collapsible button */
.navbar-default .navbar-toggle {
border-color: transparent;
}
/* Dropdown */
.open .dropdown-toggle {
color: #fff ;
background-color: #555 !important;
}
/* Dropdown links */
.dropdown-menu li a {
color: #000 !important;
}
/* On hover, the dropdown links will turn red */
.dropdown-menu li a:hover {
background-color: red !important;
}
Result:
-----example mukavu -----
Add Scrollspy
To have navbar links automatically refresh when scrolling, add scrollspy:
Example
Add a Footer
1. Add some text to the <footer> element.
2. Style the footer using CSS.
3. Include a “Up Arrow” icon that, when clicked, will navigate the user to the top of the page.
4. Initialize the tooltip plugin using jQuery:
Example
Result:
-----example mukavu -----
Adding Smooth Scrolling
To enable seamless scrolling (when clicking on the links in the navbar), use jQuery:
Example
Final Touch
Choose a typeface that you like to add to personalize your theme. The Google Font Library’s “Montserrat” and “Lato” were utilized.
In the <head> section, provide a link to the font:
<link href=”https://fonts.googleapis.com/css?family=Montserrat” rel=”stylesheet” type=”text/css”>
<link href=”https://fonts.googleapis.com/css?family=Lato” rel=”stylesheet” type=”text/css”>
Then, you can utilize them on this page:
Example
body {
font: 400 15px/1.8 Lato, sans-serif;
color: #777;
}
.navbar {
font-family: Montserrat, sans-serif;
}
We have also added some extra style to some elements:
Example
/* Overwrite default styles of h3 and h4 */
h3, h4 {
margin: 10px 0 30px 0;
letter-spacing: 10px;
font-size: 20px;
color: #111;
}
/* Remove rounded borders on input fields */
.form-control {
border-radius: 0;
}
/* Disable the ability to resize textareas */
textarea {
resize: none;
}