There seems to be a problem with the Bootstrap Container and Container Fluid

I am currently utilizing Bootstrap 3.3.7 and have incorporated buttons to enhance the content on my webpage.

Upon using container-fluid, I noticed that it does not expand the content across the entire page but rather confines it to the center area of the page.

A similar issue arose when I tried using the container class. The content extended beyond the page's boundaries. My screen resolution is 1366 x 768.

This is the code snippet I implemented


    <div class="container">

      <h4>Bootstrap Buttons</h4>

      <!-- Large size buttons -->
      <p>
        <button type="button" class="btn btn-default btn-lg">Default</button>
        <button type="button" class="btn btn-primary btn-lg">Primary</button>
        <button type="button" class="btn btn-success btn-lg">Success</button>
        <button type="button" class="btn btn-info btn-lg">Info</button>
        <button type="button" class="btn btn-warning btn-lg">Warning</button>
        <button type="button" class="btn btn-danger btn-lg">Danger</button>
        <button type="button" class="btn btn-link btn-lg">Link</button>
      </p>

      <!-- Default size buttons -->
      <p>
        <button type="button" class="btn btn-default">Default</button>
        <button type="button" class="btn btn-primary">Primary</button>
        <button type="button" class="btn btn-success">Success</button>
        <button type="button" class="btn btn-info">Info</button>
        <button type="button" class="btn btn-warning">Warning</button>
        <button type="button" class="btn btn-danger">Danger</button>
        <button type="button" class="btn btn-link">Link</button>
      </p>

      <!-- Small size buttons -->
      <p>
        <button type="button" class="btn btn-default btn-sm">Default</button>
        <button type="button" class="btn btn-primary btn-sm">Primary</button>
        <button type="button" class="btn btn-success btn-sm">Success</button>
        <button type="button" class="btn btn-info btn-sm">Info</button>
        <button type="button" class="btn btn-warning btn-sm">Warning</button>
        <button type="button" class="btn btn-danger btn-sm">Danger</button>
        <button type="button" class="btn btn-link btn-sm">Link</button>
      </p>

      <!-- Extra small size buttons -->
      <p>
        <button type="button" class="btn btn-default btn-xs">Default</button>
        <button type="button" class="btn btn-primary btn-xs">Primary</button>
        <button type="button" class="btn btn-success btn-xs">Success</button>
        <button type="button" class="btn btn-info btn-xs">Info</button>
        <button type="button" class="btn btn-warning btn-xs">Warning</button>
        <button type="button" class="btn btn-danger btn-xs">Danger</button>
        <button type="button" class="btn btn-link btn-xs">Link</button>
      </p>  

    <!-- Bootstrap container & container-fluid -->
    <!-- Example of a container in Bootstrap -->
    <div class="container bootcontainer">
      <h1>Hello, world! - Using Container</h1>
    </div>

    <!-- Example of a container fluid in Bootstrap -->
    <div class="container-fluid bootcontainerfluid">
      <h1>Hello, world! - Using Container Fluid</h1>

    </div>

Answer №1

This particular element serves as the main holder for all other elements, thus:

   <!--Illustrative Use of Bootstrap Modal (Dialog Box / Pop-up Window)-->
      <div class="main-holder-fluid">
       ...

Simply substitute element with main-holder-fluid wherever necessary, it worked like a charm for me.

Answer №2

Ah-ha! The solution was as simple as an HTML break. I forgot to include the <div> tag for the 'Bootstrap Button Example'.

Appreciate the help!

Best regards, Chiranthaka

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issues with CSS rotation not functioning as intended

Seeking assistance with CSS animation: How can I make the elements :before rotate? Link to code on jsFiddle CSS .footerLink{ padding:20px; background:#000; color:#fff; } .footerLink:before{ content:'ABC'; margin-right:15px; ...

Tips for preventing double foreach loops in Laravel when dealing with backward relationships

I'm attempting to display variables using the following relationships: First: public function group(){ return $this->belongsTo(Group::class); } Second: public function joinGroups(){ return $this->hasMany(JoinGr ...

What could be causing my ajax not to retrieve the text currently being typed in the input form?

I am facing an issue with my form where I am unable to update the data when typing something new into the input field. It seems like the form is not picking up the currently typed string when on the update page, and instead it's using the echoed out v ...

Using jQuery to select a div element that has been dynamically loaded using ajax, or inserted into the DOM using the html()

Greetings from a newcomer to stackoverflow! After searching for similar questions and answers, I still couldn't find a solution to my specific problem. Here's the situation: I have a webpage that uses ajax to load main content. The function for ...

creating interconnections between input fields by employing event listeners in JavaScript

I've been experimenting with binding multiple input fields to a span element using jQuery. Specifically, I have two input fields containing integer values and the sum of these values is displayed in a span element. I want the span element to update wh ...

Access information from multiple div elements using JavaScript data-attributes

Having trouble retrieving data-attribute values from multiple divs with the same class when clicked. The goal is to display the data value of the clicked div. function playSound(e) { const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`) ...

Is there a way to enable hover functionality on mobile devices? I wish for the hover effect seen on desktop to be triggered automatically on mobile devices

I attempted to implement @media (hover: hover) without success. In my design, I have three images in a row that reveal a text overlay when hovered over with a mouse. However, the issue arises when I try to switch to a mobile view, as the images remain un ...

Interactive jQuery Popup character map

Is there a jQuery plugin available for a popup 'character map'? I have a text field and want users to easily insert special characters, like the TinyMCE plugin. ...

Enhance Your Profile with Bootstrap 4 Dropdowns

I am trying to incorporate a dropdown profile into my navbar, but it is not appearing where it should be located: pic1 <link href="https://bootswatch.com/4/materia/bootstrap.min.css" rel="stylesheet"/> <script src="https://code.jquery.com/j ...

What is the best way for an object to recognize if its value matches a key in another object, and then retrieve that value

Is there a way to make an object detect if its value is equal to another object's key and then retrieve it? Let's consider the following object named: AnswerString let AnswerString ={ 0: "B", 1: "x" } and the answers are in different objects, ...

What is the best way to divide two ranges that are intersecting?

Seeking a method to divide two overlapping ranges when they intersect. This is my current progress using typescript, type Range = { start: number; end: number; }; function splitOverlap(a: Range, b: Range): Range[][] { let result = []; const inters ...

Modifying an object's value before pushing it into an array in JavaScript

I've been struggling to find the right keyword to search for my issue. I've spent hours trying to figure out what's wrong, but it seems like a simple case of pushing an object into an array. The problem arises when I try to log the values of ...

Determine the total of the values in an array by adding or subtracting them

I am currently working on a form that contains approximately 50 similar elements organized in a table. Each item in the table consists of three records. The elements are retrieved from the database and displayed in the table using the following code: ...

Can AngularJS filter be used with an array of strings for sorting?

Understanding how to implement an Angular filter to solve a problem I'm facing is proving to be quite challenging for me. Let's take a look at a simple example of my data structure, which consists of an array of tasks: var tasks = [ { Title ...

Customize context menu events based on the exact section where the menu was activated

Concern: The context menu functions, but it retains click events if pulled up on multiple divs. Steps to Replicate: Right-click one section. Click outside the menu to close it (without choosing an option). Click another section and choose an option. Delet ...

I am looking to consolidate my array of objects into a single object with distinct keys

Hey there! I'm looking to showcase the expenses for each category throughout the months of the year. Here's an example: {Month: "January", Food: 610, foodColor: "#063951", Others: 121, othersColor: "#C13018", …} Fo ...

When you invoke a function within Angular 1.5 as a fresh component emerges

I have a component where clicking on a button triggers the invocation of another component. model.alert = function () { modalInstance = $uibModal.open({ template: '<abc-xyz return-value="model" on-cancel="Cancel()">& ...

Uninstalling Puppeteer from npm can be done by running a

Some time ago, I had integrated Puppeteer into an Express API on Heroku using their Git CLI. Recently, I decided to remove Puppeteer from the package.json file and went through the npm install process before trying to push to GitHub. However, it appears th ...

Error encountered with React Hooks - TypeError

What I Aim to Achieve Our goal is to utilize Next.js to create a button named 'ConnectMetamask' that, upon clicking, triggers the predefined hooks and stores the value in a variable called 'userSigner'. This functionality is implemente ...

Create a dropdown menu with selectable options using a b-form-select

I am working with a b-form-select element that displays options based on user input. I am trying to figure out how to trigger a function when the user selects one of the dynamically generated <b-form-option> elements, but I am struggling to capture b ...