Ensure text is neatly enclosed within bs4 containers

I'm encountering a significant issue with my bs4 boxes that I can't seem to resolve. The primary concern is that when the browser size falls between 600-767.98px and 768-991.98px (as per Dreamweaver), the text within the middle three boxes fails to wrap properly, causing it to overflow outside the box. This issue only arises at certain browser sizes, while at others it functions correctly.

<div class="d-md-flex flex-md-equal w-100 my-md-3 pl-md-3 alert-banner">
<h1 class="bg-danger text-white mr-md-3 px-md-5 text-center overflow- 
hidden">Applications for crew and production staff are up on the information 
page</h1>
</div>
<div class="bg-dark">

 <div class="container-fluid w-100 overflow-hidden">
  <div class="row">

  <a class="col-sm bg-dark my-5 ml-3 text-center box-1 mr-sm-3 pt-3 px-3 pt- 
 md-5 px-md-5" href="Tickets">
    <div class="my-3 p-3">
      <h2 class="font-weight-bold">Tickets</h2>
      <h3>Buy tickets here</h3>
    </div>
  </a>

  <a class="col-sm bg-primary my-5 text-center box-2 pt-3 px-3 pt-md-5 px- 
md-5 overflow-hidden "href="for-students">
    <div class="my-3 p-3">
      <h2 class="font-weight-bold">Information</h2>
      <h3>All forms, documents, and important information will be here</h3>
    </div>
  </a>

  <a class="col-sm my-5 mr-3 ml-3 text-center box-3  mr-md-3 pt-3 px-3 pt-md-5 px-md-5" href="#">
    <div class="my-3 p-3">
    <h2 class="font-weight-bold">Previous Years (coming soon)</h2>
    <h3>View photos from previous shows</h3>
    </div>
  </a>
</div>

<div class="row mx-auto">
  <div class="mr-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden col-sm bg-dark">
    <h2 class="display-5">Want to buy an ad on this site to sponsor the play?</h2>
    <p class="lead">Email us - <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76060419120315021f191836141b1e051b03051f15171a5815191b">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76060419120315021f191836141b1e051b03051f15171a5815191b">[email protected]</a></a> (Limited quantity available)</p>
  </div>

</div>

Answer №1

To eliminate unnecessary padding classes like mr-3,pl-2,pt-md-5, simply add the col-sm-4 class to divide the column and include just one consistent padding class. Give this example a try, it may be more suitable for your needs.

.box-1,.box-2,.box-3 {
    display: flex;
    flex-wrap: wrap;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
  <div class="alert-banner m-3">
    <h1 class="bg-danger text-white text-center p-3">Applications for crew and production staff are up on the information page</h1>
  </div>
  <div class="bg-dark">
      <div class="container-fluid w-100 overflow-hidden">
          <div class="row text-center equl-col py-5">
              <a class="col-sm-4 box-1 mb-3 mb-sm-0" href="Tickets">
                  <div class="bg-danger d-flex w-100">
                      <div class="p-3 align-self-center w-100">
                          <h2 class="font-weight-bold">Tickets</h2>
                          <h3>Buy tickets here</h3>
                      </div>
                  </div>
              </a>
              <a class="col-sm-4 box-2 mb-3 mb-sm-0" href="for-students">
                  <div class="bg-primary d-flex w-100">
                    <div class="p-3 align-self-center w-100">
                      <h2 class="font-weight-bold">Information</h2>
                      <h3>All forms, documents, and important information will be here</h3>
                    </div>
                  </div>
              </a>
              <a class="col-sm-4 box-3 mb-3 mb-sm-0" href="#">
                <div class="bg-danger d-flex w-100">
                  <div class="p-3 align-self-center w-100">
                      <h2 class="font-weight-bold">Previous Years (coming soon)</h2>
                      <h3>View photos from previous shows</h3>
                  </div>
                </div>
              </a>
          </div>
          <div class="mx-auto">
              <div class="p-3 text-center overflow-hidden col-sm bg-dark">
                  <h2 class="display-5">Want to buy an ad on this site to sponsor the play?</h2>
                  <p class="lead">Email us - <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b4b49545f4e584f5254557b59defed080f4f8e3f9dbe4f1f3">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2f5f5d404b5a4c5b465b5d5a5f53da5d41694a5d5d5c5843454841">[email protected]</a></a> (Limited quantity available)</p>
              </div>
          </div>
       </div>
   </div>

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

Personalized cursor image using jQuery.css()

I have designed a .png image that I want to use as a custom cursor for a particular element with the class "next". Here is the code I am using, but it doesn't seem to be working. Is there anything important that I may have overlooked? $('.next& ...

What are some clever ways to outsmart bootstrap rows?

Trying to find a way to work around Bootstrap rows. I have multiple col-..-.. items that I need to fit into one row, but modifying 8 complex .js files is not an option for me - and they refer to the children of the div I used as a bootstrap row. HTML manip ...

Unable to Trigger Click Event on Div Element in Angular 9

Take a look at my HTML code snippet <mat-grid-list cols="3" rowHeight="150px"> <mat-grid-tile *ngFor="let tile of tiles;index as j;" [colspan]="tile.cols" [rowspan]="tile.rows" ...

Flexbox properties are being ignored by input fields

Hey there, I'm currently working on a product calculator and need to create 9 input fields organized in 3 rows of three columns. However, when I try to use display: flex and flex-direction: row on the parent div, it doesn't seem to be working as ...

Background of jQuery-UI Slider

Can the background color of a jQuery-UI Slider widget be set using JavaScript? This is the default setting: What I am trying to accomplish is the following: The green range should be determined based on historical data. I want to visually show the user ...

Displaying a <div> element within a :before pseudoelement

Implementing the use of :before to insert an icon font into a div for a CSS3 hover state. I am looking to incorporate a div within the <a> tag in order for both elements to function as links: <a href="#set-4" class="column product hi-icon product ...

Rendering React.js components as children of DOM elements

Trying my hand at creating a custom Map component includes the task of designing a unique Map Annotation. Here's an example of how a MapAnnotation component appears in the render function: <MapAnnotation title='Annotation' latitude={ 12.3 ...

The datepicker on mobile devices fails to display the default text of dd/mm/yyyy

This JSP code uses Bootstrap5: <form action="" method="GET" class="row g-1 mb-3 "> <div class="col-lg-2 col-md-4 col-6 mb-2"> <input type="date" class="form-control" name=" ...

Issues with loading CSS, JavaScript, and links when deploying a Spring Boot application as a WAR file in Tomcat

My Spring boot web application runs smoothly as an executable jar, but when I build it as a war and deploy it to Tomcat, the CSS and JS files fail to load. Upon further investigation, I discovered that all links are pointing to the root context path "/" I ...

Tips for organizing appended <li> elements using jQuery

Being a novice in the realm of programming, I ask for your understanding as I pose what may seem like a simple question. Up until now, I have been unable to find a satisfactory solution to my issue. Within my HTML Code lies an unordered list, serving sole ...

Looking for assistance with troubleshooting my isotope.js [code written in jquery and html]?

Explore this JSFiddle link I'm attempting to create sortable fancybox images, similar to the filtering functionality seen on this website. I previously achieved this with v1 of isotope but have been struggling with v2. After countless attempts and ad ...

When using threejs, the color set for setClearColor is supposed to be white. However, when calling an external HTML file, it unexpectedly renders as

When I call an external HTML file in Three.js, the value for setClearColor is white but it renders as black. How can I solve this issue? Click here to view the image Here are the codes from the external file: <div id="3d-modal"></div> <sc ...

Having trouble resizing divisions using three.js?

Three.js is an incredible library that offers thorough documentation and functions perfectly. I am currently attempting to display a plane with trackball control inside a div that resizes according to the window or browser size. However, I am encountering ...

Is there a way to create a footer similar to this one?

I need to create a footer, but I'm struggling with placing a circle at the top half of the footer like this. Even though I can create a footer, I still encounter some issues. This is the code I have right now: .Footer { position: fixed; left: ...

How can I get rid of the extra space below the container in bootstrap?

I need to enhance the red-framed box_switch section in the image above by moving it to the top and applying a background color. https://i.sstatic.net/NZPUQ.png React.js <div className="container"> <div className="row mx-auto t ...

Tips for setting up an automated system to check feeds

While I have experience parsing and setting up databases in PHP, I am now faced with the challenge of constantly monitoring an XML feed for a specific string within one of the tags. Each time this string is detected, I need to add the entire XML item (incl ...

Django website experiencing issues with displaying background image

Hey there! I'm experiencing a bit of an issue with getting my website background to display properly. I built my site using a combination of HTML, CSS, and Django/Python for the backend, and it's currently hosted on Heroku. The strange thing is, ...

Individuals have the capability to utilize .php as an image extension

It seems that someone is able to use any type of extension as long as they add .png at the end of the link. is currently being used, causing users on my website to log out when visiting the homepage. I tried to stop this issue, but unfortunately, my sol ...

Stop the iframe video when the modal is closed

I'm currently developing a website that incorporates the code showcased in this tutorial to launch a modal window featuring an iframe for playing YouTube or Vimeo videos. The issue arises when, as mentioned in the comments on the tutorial page, there ...

Ensuring the alignment of a personalized list bullet with the accompanying text

Looking to make the bullet point next to an li element larger? The common approach is to eliminate the standard point, add a custom one using the :before selector, and adjust the font size of the added point. While this technique somewhat achieves the goa ...