Google News
logo
Bootstrap-4 Interview Questions
Bootstrap 4 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites. Bootstrap 4 is completely free to download and use!
Bootstrap 4 alpha 1 was released on 19th August 2015. Since then there have been many alpha releases. And finally after that on 10th August 2017, Bootstrap released 

the first beta for the version 4 of Bootstrap. Bootstrap 4 Beta 2 was released on October 19th, 2017. 
Easy to use : Anybody with just basic knowledge of HTML and CSS can start using Bootstrap 4

Responsive features : Bootstrap's responsive CSS adjusts to phones, tablets, and desktops

Mobile-first approach : In Bootstrap 4, mobile-first styles are part of the core framework

Browser compatibility : Bootstrap 4 is compatible with all modern browsers (Chrome, Firefox, Internet Explorer 10+, Safari, and Opera).
Bootstrap's media object component provides an easy way to align text and media objects when presenting them alongside each other. It allows you to quickly and easily float media to the left and/or right of a content block. 

Only two classes are required : The wrapping .media and the .media-body around your content. Optional padding and margin can be controlled through spacing utilities.
Bootstrap provides classes that can be used when working with the img element and examples for opting images into responsive behavior and add lightweight styles to them all classes.

i) Responsive images
ii) Thumbnail
iii) Aligning Images
iv) Image Shapes & Corners.
Responsive images automatically adjust to fit the size of the screen. Bootstrap are made responsive with .img-fluid class to the  tag.  The .img-fluid class applies max-width: 100%; and height : auto; are applied to the image so that it scales with the parent element.

<img src="image.jpg" class="img-fluid" alt="responsive Image">
The .img-thumbnail class shapes the image to a thumbnail (bordered): 
<img src="image.jpg" class="img-thumbnail" alt="thumbnill image" />
The Bootstrap 4 image alignments are mainly used two classes there are .float-left, .float-right .

<img src="image_1.jpg" class="rounded float-left" alt="bootstrap 4 image">
<img src="images_2.jpg" class="rounded float-right" alt="bootstrap 4 image">
You can use Bootstrap to render images with rounded corners or as a circle. This is achieved with the .rounded-* utility classes.

<img src="image_1.png" class="rounded" alt="rounded image">
<img src="image_2.png" class="rounded-circle" alt="rounded-circle image">
<img src="image_3.png" class="img-thumbnail" alt="img-thumbnil image">
<img src="image_4.png" class="rounded-top" alt="rounded-top image">
<img src="image_5.png" class="rounded-bottom" alt="rounded-bottom image">
<img src="image_6.png" class="rounded-0" alt="rounded-0 image">
The bootstrap 4 colors are mainly three :

Text Colors :  .text-primary, .text-success, etc,..
Link Colors :  .text-white and .text-muted
Background Colors :  .bg-primary, .bg-success, etc,..
Use bootstrap 4 to create beautiful tables. Bootstrap 4 version has some new classes for inverting the table color and making the table responsive.

Table Dark : The .table-dark class adds a black background and white color fonts to the table
Table head : You can add a background color to the <thead> element by using either .thead-light or .thead-dark. 
etc,...
The Bootstrap 4 forms are textual form controls like <input>, <textarea>, and <select> elements with class .form-control have a width of 100% by default. 

Horizontal form : Create horizontal forms with the grid by adding the .row class to form groups and using the .col-*-* classes to specify the width of your labels and controls.

Be sure to add .col-form-label to your <label>s as well so they’re vertically centered with their associated form controls. For <legend> elements, you can use .col-form-legend to make them appear similar to regular <label> elements.

Form and Label Sizing : To Use .col-form-label-sm or .col-form-label-lg to your <label>s to correctly follow the size of .form-control-lg and .form-control-sm.

And so many forms is there Inline Forms, Help text & Disabled Forms, Readonly plain text, etc,.

Bootstrap's included navigation components list into "tabs" and navigation "pills". To add a tab or nav pill, add the .nav class and either .nav-pills or .nav-tabs to a <ul> element containing the list of navigation items. 
Bootstrap 4 navbars is a simple and powerful, responsive navigation header, the navbar. Includes branding, navigation, and other elements into a navigation header,  including support for our collapse plugin.

A standard navigation bar is created with the .navbar class, followed by a responsive collapsing class { .navbar-expand-sm | -md |-lg | -xl  }.
Bootstrap 4 provides an easy way to create a stylized alert message box with its alert component. Alerts are created with the .alert class, followed by one of the 
contextual classes .alert-primary, .alert-success, etc,..

To create a bootstrap 4 badge, apply the .badge class, as well as one of the .badge-primary, .badge-secondary, etc,..

Button Badges : Badges can be used as part of links or buttons to provide a counter.
<button type="button" class="btn btn-primary"> Tutorials <span class="badge badge-light">14</span> </button>

Contextual Badges : The contextual classes (.badge-*) to change the color of a badge.
<span class="badge badge-default">Default</span>
<span class="badge badge-primary">Primary</span> etc,..

Pill Badges : Use the bootstrap 4 pill badges are add .badge-pill class to make the badges more round.
<span class="badge badge-pill badge-default">Default</span>
<span class="badge badge-pill badge-primary">Primary</span> etc,..
Bootstrap's cards provide a flexible and extensible content container with multiple variants and options. 

A bootstrap card it includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.

For more examples please Click Here !.
Bootstrap 4 progress bars featuring support for stacked bars, animated backgrounds, and text labels. To create a default progress bar, add a .progress class to a container element and and the .progress-bar class to its child element.
Bootstrap 4 Pagination to indicate a series of related content exists across multiple pages. Add the .pagination class to an <ul> element. Then add the .page-item to each <li> element and a .page-link class to each link inside <li>.
Quickly configuring the position of an elements are .position-static, .position-relative, .position-absolute, .position-fixed, .position-sticky. Mainly three positions are there.

Fixed top : <div class="fixed-top">...</div>
Fixed bottom : <div class="fixed-bottom">...</div>
Sticky top : Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The .sticky-top utility uses CSS’s position: sticky, which isn’t fully supported in all browsers.

Microsoft Edge and IE11 will render position: sticky as position: relative.

<div class="sticky-top">...</div>.
Make flex-items shrink on small screen using the flex-sm-shrink-1 class used in Bootstrap.
Display flex items horizontally and right-align on medium screen using the flex-md-row-reverse class in Bootstrap.
Display flex items in the center of a flex container on extra-large screen using the justify-content-xl-center class used in Bootstrap.
 
We have used xl for extra-large screen size :
 
<div class="d-flex justify-content-xl-center bg-primary">

      Flex items
      -----------
      -----------

</div>
By default Bootstrap4 use font-size of 16px with line-height of 1.5. The default font-family is “Helvetica Neue” which is a combination of Helvetica, Arial, sans-and serif.