The display of a Bootstrap grid featuring three columns is not rendering accurately

In my bootstrap-4 layout, I have a 3 column grid where I want the middle column to be wider. However, adjusting the classes doesn't render the content correctly in the central column and makes the inner container thin. Even when I specify a width using class="col-8", the container and input don't inherit it as expected.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<div class="container-fluid">
<div class="row">
<div class="col">
   <br /><br>
   <h2>
      <p style="text-align: left;">title</p>
   </h2>
   <br><br>
   <h6 class="font-italic">
      <span style="padding-left: 15px;">
      <a href="{{ summary['url'] }}" target="_blank" rel="noopener noreferrer" class="slink">summary </a>
      </span>
   </h6>
   <pre><p id="doc_summary"></p></pre>
   <span><a id="more|less" onclick="toggleText();" href="javascript:void(0);"></a></span>
</div>
<div class="col-8">
   <div style="text-align: center;">
      <div style="display: inline-block; text-align: justify;">
         <div class="container-fluid border pt-3 full-page justify-content-center" id="con-result">
            <pre><div id="result"></div></pre>
         </div>
         <br>
         <div>
            <input class="col-md-9" id="input_text" name="input_text" placeholder="Enter a prompt here">
            <br>
         </div>
         <br><br><br>
      </div>
   </div>
</div>
<div class="col">
    some text
</div>
</div>
</div>

CSS:

.full-page {
        height: 58vh;
        overflow-y: scroll;
        border-radius: 20px;
    }
    

Any suggestions on how to fix this issue would be greatly appreciated! Thank you!

Check out the live demo here

Answer №1

Take a closer look at this snippet of your code:

Consider the following line:

<div style="display: inline-block; text-align: justify;">

By using inline-block, you are able to define both width and height for the element. Alternatively, you could switch the display property to something like grid, or simply assign a width of 100% to the div element. This adjustment should produce the desired result, assuming I have correctly interpreted your question.

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

The hierarchy of the <div> element within the <ul> element gets altered in Internet Explorer due to the ASP.NET Repeater control

Using a Repeater control, I am displaying a list of elements with the following code snippet: <td id="tdLeftBlock"> <ul id="leftList"> <asp:Repeater ID="rptLatestListingsLeft" runat="server" ...

What is the best method for eliminating tiny spaces between images that are aligned horizontally?

Check out this link for more details: . I am looking to eliminate the slim vertical gaps between the images in html5 without resorting to using the table cellpadding="0" cellspacing="0". Any ideas on how to achieve this? ...

Display various JavaScript function outputs in an HTML table for convenient tracking

Thanks to a helpful user on this platform, I was able to capture data from a JavaScript function and display it in an html table. However, I now have another query. How can I execute the function multiple times during page load and record the results in ...

Designing a webpage layout using Bootstrap 4 that includes a horizontal/inline form and two columns

Just when I felt confident in my understanding of bootstrap, it seems to be giving me trouble :( I am aiming to create a layout with 2 columns, each containing a question followed by a small text box for entering a number. Here is an example of the layou ...

Activate Bootstrap Modal with a Click of a Button

I'm interested in customizing a Bootstrap 4 modal, similar to the example on this page: https://www.w3schools.com/bootstrap4/bootstrap_modal.asp. My goal is to trigger the modal to open when clicking on specific text instead of a button. I believe us ...

Tips for resolving the "Forbidden compound class names" error that occurs when trying to select an input field

As a newcomer to selenium, I am eager to start testing the login page. The text field below is where I need to input the username: <div class="WODM WNDM" data-automation-id="userName"> <div class="gwt-Label WBEM">Email Address</div><i ...

PHP form functioning correctly on one domain but not on the other

After successfully developing my client's website on my test domain and resolving any issues with the help of the stackoverflow community, I uploaded it to my client's domain. Surprisingly, the form stopped working once it was transferred, despit ...

Getting rid of the upper boundaries and outlines of the Bootstrap table

React code: <div style={{paddingLeft: '8px', paddingRight: '8px'}}> <div className="-subtitle"> <div className="pull-right" style={{marginBottom:'5px' ...

Verify if the button is assigned a specific class, then generate a 'completed' div

I'm new to working with Jquery and I have a question. In my upload form, when something is uploaded the upload-button changes class from: <a class="upload-button upload buy" id="upload-button"><span>Upload a document</span></a> ...

A guide on dynamically adding a CSS stylesheet to an Angular component during runtime

I have a requirement to dynamically inject a stylesheet into a component at runtime. The CSS url needs to change depending on user configuration settings and the selected theme. Using styelUrls for static injection won't work in this case, as it is s ...

PHP code not functioning properly due to div tag

How can I style a sentence within PHP using echo to display a div? The CSS seems correct, but the styling is not being applied. I believe there might be an issue with how I am calling a div within PHP. Can you please provide some advice? This is what I ha ...

Implement Clip Function with Gradient Effect in JavaScript on Canvas

Trying to incorporate the clip() function within the canvas element to create a unique effect, similar to the one shown in the image. I have successfully achieved a circular clip, but I am now aiming for a gradient effect as seen in the example. How can th ...

Trouble with CSS Positioning: Resizing my browser causes my image to shift in position

Upon resizing the browser window, my website layout adjusts accordingly and looks as intended at a smaller size: However, as I begin to expand the browser width, the centrally positioned image starts shifting towards the left. I aim for the image to remai ...

Triangle shape with transparent background on top of iframe or div

Currently facing an issue where I need to add an iframe containing maps to my page. However, I also need one (or two) triangles placed over this iframe with a transparent background. I attempted this solution, but unfortunately, it did not work as expect ...

Woocommerce Dual Column Payment Portal

I prefer a two-column layout for the checkout process on www.narwal.shop/checkout Here is the code I added: /* Large devices (large desktops, 1200px and up) */ @media (min-width: 993px) { /* --------------------- WOOCOMMERCE -------- ...

Can someone provide guidance on styling bidirectional text within a tooltip using bootstrap 4?

Is there a way to make Bootstrap tooltips display a mix of left-to-right and right-to-left languages, with the main direction being right-to-left? For example, I want the tooltip content to appear as "كلمة1 Word2 كلمة3 Word4 كلمة5", where the w ...

What is the most effective approach for delivering arguments to event handlers?

Consider the following block of HTML: <button id="follow-user1" class="btnFollow">Follow User1</button> <button id="follow-user2" class="btnFollow">Follow User2</button> <button id="follow-user3" class="btnFollow">Follow User ...

What is the reason behind the failure of the jquery.hide() function on this particular UL element?

Although the submenu displays correctly, it refuses to hide when using the mouseleave function. Oddly enough, a console.log() confirms that an event does trigger at the right moment when the mouse exits the <ul>, yet the submenu remains visible for ...

The error message for an onclick event in HTML/JavaScript references a ReferenceError, and also involves issues with

Currently, I am working on creating a simple text-based golf game as a coding exercise. This game does not involve any trigonometry; instead, it relies on randomness to determine how hard the ball is hit and how many shots are required to reach the hole. A ...

How can I link an HTML file to a different port?

Here is an example of a simple tag that creates a link to a page without the need for the full URL: <a href="foo.html">link</a> If you were to click this link from example.com/, you would be directed to example.com/foo.html. Is there a method ...