Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How would you implement a carousel in bootstrap?

Answer»

Here is an example with a detailed explanation:

<div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ul class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ul> <!-- Wrapper --> <div class="carousel-inner"> <div class="carousel-item active"> <img src="ap.jpg" alt="Apple"> <div class="carousel-caption"> <h3>APPLE</h3> </div> </div> <div class="carousel-item"> <img src="or.jpg" alt="Orange"> <div class="carousel-caption"> <h3>ORANGE</h3> </div> </div> <div class="carousel-item"> <img src="kw.jpg" alt="Kiwi"> <div class="carousel-caption"> <h3>KIWI</h3> </div> </div> </div> <!-- Left and Right Controls --> <a class="carousel-control-prev" href="#myCarousel" data-slide="prev"> <span class="carousel-control-prev-icon"></span> </a> <a class="carousel-control-next" href="#myCarousel" data-slide="next"> <span class="carousel-control-next-icon"></span> </a></div>

The outermost <div> is as follows:

  • For carousel controls to WORK properly, they must have an id (in this case, id="myCarousel").
  • This <div> has the class="carousel" to indicate that it contains a carousel.
  • When a new item is displayed, the .slide class adds a CSS transition and animation effect that causes the objects to slide. If you don't want this effect, leave this class out.
  • When the page loads, the data-ride= "carousel" attribute TELLS BOOTSTRAP to start animating the carousel right away.

The section on "Indicators" is as follows:

  • Each slide's indicators are the small dots at the bottom (which indicates how many slides there are in the carousel, and which slide the user is currently viewing).
  • With the class .carousel-indications, the indicators are supplied in an ordered list.
  • The data-target attribute refers to the carousel's id.
  • When a user clicks on a given dot, the data-slide-to attribute defines the slide they should GO to.

The "Wrapper" section is as follows:

  • A div with the class .carousel-inner specifies the slides.
  • Each slide's content is defined by a div with the class .item. This can be in the form of text or visuals.
  • One of the slides must have the .active class APPLIED to it. The carousel will not be viewable otherwise.
  • To generate a caption for each slide, a <div class="carousel-caption"> is added within each <div class="item">.

The section on "Left and Right Controls" is as follows:

  • This code adds "left" and "right" buttons, allowing the user to manually navigate between slides.
  • The data-slide attribute takes the keywords "prev" or "next," which change the position of the slide in relation to its current location.
2.

What is the media object in Bootstrap and what are their types?

Answer»

Bootstrap's media objects allow you to position media objects such as images, videos, and AUDIO to the left or RIGHT of content blocks. Media elements can be constructed using the class .media and the SOURCE is specified by using the class .media-object. There are two TYPES of media objects:

  • .media
  • .media-list
3.

Write the HTML code to create a basic toast.

Answer»

When something happens, the TOAST COMPONENT acts as an alert box that only appears for a few seconds (i.e. when the user clicks on a button, SUBMITS a FORM, etc.).

<div class= "toast" > <div class= "toast-header" > Toast Header </div> <div class="toast-body"> Toast Body Text </div></div>
4.

Discuss Bootstrap table and various classes that can change the appearance of the table.

Answer»
  • A BASIC Bootstrap 4 table features HORIZONTAL divisions and light padding.
  • The .table class GIVES a table some basic styling.
  • The .table-striped class gives zebra stripes to the table.
  • The .table-bordered class adds borders to the table and CELLS on all sides.
  • On table rows, the .table-hover class adds a hover effect (grey background color).

Here is how the zebra-striped table LOOKS like:

5.

Explain input groups in Bootstrap.

Answer»

The .input-group class is a CONTAINER for enhancing an input by adding a "HELP TEXT" icon, text, or button in front or BEHIND the input field.

To ADD the help text in front of the input, use .input-group-prepend, and to add it behind the input, use .input-group-append.

Finally, style the provided help text with the .input-group-text class.

6.

What are the two types of spinners that you can create using Bootstrap?

Answer»

Use the .spinner-border class to MAKE a spinner/loader.

&LT;div class= "spinner-border" &GT;</div>

If you want the spinner/loader to grow INSTEAD of "spin", use the .spinner-grow class.

<div class= "spinner-grow" ></div>
7.

What is a bootstrap card and how would you create one?

Answer»

In Bootstrap 4, a card is a bordered box with padding surrounding its content. It has options for HEADERS, footers, content, and colors, among other things.

<DIV class="card"> <div class="card-header">Header</div> <div class="card-body">Body</div> <div class="card-footer">Footer</div></div>

Another example:

<div class="card" STYLE="width:400px"> <img class="card-img-top" src="img_avatar.png" alt="Card image"> <div class="card-body"> <h4 class="card-title">RICHARD Taylor</h4> <p class="card-text">Some example text.</p> <a href="#" class="btn btn-primary">See Profile</a> </div></div>

 

8.

How can one create an alert in Bootstrap?

Answer»

Create a wrapper <div> and add a class of .alert and ONE of the CONTEXTUAL classes to create a basic alert (e.g., .alert-success, .alert-info, .alert-warning, .alert-danger, .alert-primary, .alert-secondary, .alert-light or .alert-dark).

9.

What contextual classes can be used to style the panels?

Answer»

To MAKE a PANEL more meaningful to a SPECIFIC CONTEXT, use contextual state CLASSES like panel-primary, panel-success, panel-info, panel-warning, and panel-danger.

10.

In Bootstrap, how do you make navigation elements?

Answer»

The NAVIGATION elements in BOOTSTRAP can be styled in a variety of ways. The markup and base CLASS are the same in all of these .nav. To build tabular navigation or TABS, execute the following steps:

Begin by creating an unordered LIST using the base class of .nav. The .nav-tabs class should be added.

11.

In Bootstrap 4, what is flexbox?

Answer»

Flexbox is a layout module for FLEXIBLE boxes. WITHOUT USING float or POSITIONING, you can quickly create a flexible layout design with flexbox.

12.

What is a lead?

Answer»

<P>Lead adds some emphasis to a paragraph. The .lead class is used to achieve this and it makes the font larger, TALLER, and LIGHTER in weight.

&LT;p class= "lead" > Paragraph </p>
13.

In Bootstrap, what are the two codes for displaying code?

Answer»

In Bootstrap, there are two straightforward ways to display code:

  • The <code&GT; ELEMENT is used to showcase a PIECE of inline code.
  • You can USE the <PRE> tag to display a code that has multiple lines or even a block element.
14.

How can you use Bootstrap to make thumbnails?

Answer»

To make thumbnails with BOOTSTRAP, go through the STEPS below:

Wrap an image in an <a> tag with the class .thumbnail. It will add a grey border and FOUR pixels of PADDING. An animated light will now outline the image when it has HOVERED over.

15.

What is a breadcrumb in Bootstrap?

Answer»

BREADCRUMBS are a wonderful WAY to display a site's hierarchy-based information. Breadcrumbs can show the dates of publication, categories, and tags in the case of BLOGS. They show where the current page is in the navigational hierarchy.

In Bootstrap, a breadcrumb is essentially an unordered list with the class .breadcrumb. CSS adds the separator for you automatically.

16.

What is a Button Group, and what is the class for a basic Button Group?

Answer»

Multiple buttons can be placed together on a SINGLE line using button groups. You can USE this to GROUP objects together, such as alignment buttons.

The .btn-group CLASS is used for basic button groups. You can use the class .btn to WRAP a set of buttons in .btn-group.

17.

What is the difference between Bootstrap 3 and Bootstrap 4

Answer»
PARAMETERBOOTSTRAP 3BOOTSTRAP 4
Grid System4 tier grid system (xs, sm, md, lg).5 tier grid system (xs, sm, md, lg, xl).
CSS FileLESSSASS
Button SizeBootstrap 3 supports .btn-xs class.Only .btn-sm and .btn-lg are available in bootstrap 4.
Horizontal FormWe do not need a .row class using a grid in forms..row class is needed when using the grid in form.
Inverse/dark Table.table-inverse class is not supported..table-inverse class is supported.
Primary UnitPrimary unit is px.Primary unit is rem
Table Head StylesTable head styles are not supported.In bootstrap 4, table head styles with the .thead-light and .thead-dark classes.
Condensed TablesIt supports .table-condensed.It supports .table-sm.
Responsive Image.img-responsive class is to be used..img-fluid class is to be used.
Image AlignmentUse the .pull-right and .pull-left class.One can use .pull-right, .pull-left and other such classes like .text-left and .text-center.
StructureIn order to apply dropdown list, we use <UL>, <li>In order to apply .dropdown-item, we use <a>, <button>.
ColorLimited COLORS are available; it supports inverse navbars but not other classes.There are MANY colors; .bg-dass or .navbar-light, .navbar-dark classes are supported.
Jumbotron.jumbotron-fluid class is not required for full-width..jumbotron-fluid class is required for a full-width jumbotron.
Show CONTENT.in is used to expand content when the page loads..show is used to expand content when the page loads.
GlyphiconsSupported.Not supported.
Breadcrumb class.breadcrumb class is used against the <ul> tag..breadcrumb class is used against the <li> tag.
AffixSupported.Not supported.
FlexboxNot supported.Supported.
Carousel ItemIt uses the .item class.It uses the .carousel-item class.
Dividers.divider class is applied to <li> element..dropdown-divider class is applied to <DIV> element.
Panels, Wells and ThumbnailsSupported.Not supported. Cards are used instead.
18.

What is the difference between Bootstrap 4 and Bootstrap 5

Answer»
PARAMETERBOOTSTRAP 4BOOTSTRAP 5
Grid System5 tier grid system(xs, sm, md, lg, xl).6 tier grid system(xs, sm, md, lg, xl, xxl).
ColorIt has limited colors.Extra colors have been added with the looks.
JqueryIt has jQuery along with all the related plugins.Jquery is removed and it has switched to vanilla JS with some working plugins.
Internet ExplorerBootstrap 4 SUPPORTS both IE 10 and 11.Bootstrap 5 doesn’t support IE 10 and 11.
Form elementsRadio buttons and checkboxes look different in different OS and browsers.The look of form elements does not change on different OS or browsers.
Utilities APIUtilities cannot be modified in Bootstrap 4.Bootstrap 5 allows US to modify and also create our own utility.
Vertical ClassesRelative positioning of columns is allowed.Relative positioning of columns is not allowed.
Bootstrap IconsBootstrap 4 doesn’t have its own SVG icons. Bootstrap 5 has its own SVG icons.
JumbotronBootstrap 4 supports the jumbotron.Bootstrap 5 doesn’t support the jumbotron.
Card deckThe card deck CLASS, used to create a set of cards with EQUAL width and height, is available in bootstrap 4.Card deck class has been removed in bootstrap 5.
NavbarWe have the inline-block attribute, and the default for the dropdown-menu-dark class is a white dropdown.The inline-block property has been removed, and the dropdown-menu-dark class now uses a black dropdown as the default.
Static Site GeneratorJekyll SOFTWARE is used by Bootstrap 4.Hugo software is used by Bootstrap 5.
19.

What do you know about the Bootstrap Grid System?

Answer»

The Bootstrap Grid System is a mobile-first, responsive grid system that scales up to 12 columns as the device or VIEWPORT size grows. Predefined classes for quick layout options and POWERFUL mix-ins for creating SUCCESSFUL semantic layouts are included in the system.

There are five classes in the Bootstrap 4 grid system:

  • .col- for extra small devices, whose SCREEN width is less than 576px.
  • .col-sm- small devices, whose screen width is equal to or greater than 576px.
  • .col-md- medium devices, whose screen width is equal to or greater than 768px.
  • .col-lg- large devices, whose screen width is equal to or greater than 992px.
  • .col-xl- extra large devices, whose screen width is equal to or greater than 1200px.

The classes listed above can be combined to build layouts that are more dynamic and adaptable.

20.

What are the default Bootstrap text settings?

Answer»

<P>The default font size in Bootstrap 4 is 16px, with a line-height of 1.5.

The default font family is "Helvetica Neue," which includes Helvetica, Arial, and other sans-serif fonts.

Margin-top: 0 and margin-bottom: 1rem are also set on all &LT;p&GT; elements (16px by default).

21.

What is a Bootstrap Container, and how does it work?

Answer»

A bootstrap container is a handy CLASS that GENERATES a central region on the page where we can put our site content. The bootstrap .container has the advantage of being responsive and containing all of our other HTML code. Containers are USED to pad the content within them, and there are two types of containers:

  • The .container class creates a fixed-width container that is responsive.
  • The .container-fluid class creates a full-width container that spans the ENTIRE VIEWPORT width.
22.

What are the advantages of Bootstrap?

Answer»

The following are some advantages of Bootstrap:

  • Bootstrap is simple to use and anyone with a basic understanding of HTML and CSS can GET started.
  • Features that ADAPT to phones, tablets, and desktops: Bootstrap's responsive CSS adapts to phones, tablets, and desktops.
  • A mobile-first STRATEGY: Mobile-first styles are built into the Bootstrap framework.
  • Bootstrap 4 is compatible with all modern browsers, including Chrome, Firefox, INTERNET Explorer 10+, Edge, Safari, and OPERA.