How to Detect and Run JavaScript When Bootstrap Media Query Breakpoints Change

Update: I created a small jQuery plugin that adds media query detection for Bootstrap 3 and 4 projects. You can learn more about IfBreakpoint.js here. Have you ever wanted to trigger some javascript at a certain media query value? Relying on document.width() has problems because it includes browser scrollbars. A simpler and more accurate solution… Read more »

Continue Reading

Category: Tutorials

How to Reorder Columns with Bootstrap 4 Order Classes

With Bootstrap 4 column ordering it is best to start out understanding how the natural or default column ordering works. When your browser reads your HTML code it reads from the top and works its way down reading left to right. So in a two column grid, the first column will be the first one… Read more »

Continue Reading

Category: Tutorials

How can I find a full Bootstrap class reference with descriptions?

I recently put together a desk reference of all of the Bootstrap CSS classes. It also includes sample code snippets of frequently used components. The download page also has a sortable table to help find classes by component. Bootstrap 3 Full Classes Reference Cheat Sheet Bootstrap 4 Full Classes Reference Cheat Sheet

Continue Reading

Category: Common Questions

How Do I Make an Image Responsive in Bootstrap 4?

.img-fluid <img src=”https://dummyimage.com/600×400/000/fff” alt=”placeholder image” class=”img-fluid” /> In Bootstrap 4 you would use the .img-fluid class on all images you would like to be responsive. This class tells the browser not to expand the image larger than its original size using a max-width. And it also tells it to scale down the image if the… Read more »

Continue Reading

Category: Common Questions

Bootstrap 4 Img Responsive Class Example

In Bootstrap 3 you would use the class .img-responsive but in Bootstrap 4 this class name has been renamed to .img-fluid View on codepen How to create a responsive image in Bootstrap 4 .img-fluid <img src=”https://dummyimage.com/1200×400/000/fff” alt=”responsive image” class=”img-fluid”>    

Continue Reading

Category: Common Questions

What Are the Bootstrap 4 Text Font Sizes and How Do You Change Them?

Bootstrap’s font sizes are calculated off of the body font size by using rem values. If you change the body font size all styles will be increased/decreased automatically. Rem stands for “root em” because it calculates the size based on the size of the root of the document or body tag. So Bootstrap’s global default… Read more »

Continue Reading

Category: Common Questions

Should I use my own CSS or Bootstrap?

Does your website or application have any of the following? Paragraphs, tables, buttons, lists, tabs, headings, responsive embeds, images, responsive breakpoints, etc. The main benefit of using Bootstrap is it saves you time writing common CSS styles most projects have. It is a toolkit you know is fully documented in case you need to add… Read more »

Continue Reading

Category: Common Questions

What does Bootstrap 4 data-toggle=”dropdown” do?

Have you ever noticed data-toggle=”dropdown” in Bootstrap 4 dropdown code sections and wondered what this does? Bootstrap includes a CSS stylesheet and JS full of functions to add click behaviors and interactivity. Instead of having you write custom javascript to initialize these functions, it searches the page for any elements that contain certain data attributes…. Read more »

Continue Reading

Category: Common Questions

How To Center a div Horizontally in Bootstrap 4 & 5

It is very common in web design layouts to horizontally center a column in a row or container. But how do you do that using Bootstrap classes? Below are some different ways you can achieve this effect. Update: These methods work for both Bootstrap 5 and Bootstrap 4. Here is a codepen demo for just… Read more »

Continue Reading

Category: Common Questions

How to Setup a Virtual Server Using Wamp

Create your project directory c:/wamp/www/project-name Open Wamp & Click Add a Virtual Host Fill out both of the inputs outlined in read enter the name of your site. I use projectname.test Enter the path to the directory you just created in step 1 Clear Hosts DNS Cache Open command line and enter ipconfig /flushdns Restart… Read more »

Continue Reading

Category: Common Questions