What is causing my images to exceed the boundaries of their parent columns?

Currently, I am in the process of developing a web application using asp.net. The layout of the site is being designed with Bootstrap version 4. However, I am facing an issue where the image overlaps the "Welcome to the site" title on the left-hand side when the screen is resized. Eventually, the columns stack properly, but there seems to be a problem during the transition.


        <div class="container-fluid">
            <div class="row portal-intro">
                <div class="col-md-4">
                    <p class="home-header">Welcome to the site</p>
                    <p>
                        You can create various applications, reports, and requests through our online forms.
                        For instance, applying for resident permits, reporting issues, or requesting a call back.
                    </p>
                </div>
                <div class="col-md-8">
                    <img class="img-fluid" src="~/Content/Images/city.png" />
                </div>
            </div>

        </div>

        <div class="container-fluid">
            <div class="row">
                <div class="col-md-4">
                    <h2>Getting started</h2>
                    <p>
                        ASP.NET MVC provides a robust, patterns-based approach for building dynamic websites,
                        offering clean separation of concerns and complete markup control for enjoyable development experiences.
                    </p>
                    <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p>
                </div>>
                
                <!-- More col-md-4 divs here -->

            </div>
        </div>

I tried using img-fluid to address the issue, but it persists even after that. The overlapping occurs only during the resizing process, indicating a possible problem with the left column rather than the image itself.

No additional CSS has been added, relying solely on the img-fluid class for styling.

Answer №1

Your text is overflowing the column space allocated to it due to its large size. You can rectify this issue by reducing the font size in a responsive manner. Here is an example:

@media (min-width: 768px) {
    .content-text {
        font-size: 24px;
    }
}

Check out this demonstration to see the problem visually.

It's important to use proper heading tags for your headings to maintain a semantic document structure. Learn more about semantic markup here.

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

Steps to display a variable in JavaScript on an HTML textarea

I'm working on a JavaScript variable called 'signature' var signature; //(Data is here) document.write(signature) Within my HTML document, I have the following: <div id="siggen"> <textarea id="content" cols="80" rows="10">& ...

Why is my Bootstrap 4 Modal not appearing? Just a black screen with no modal?

https://jsfiddle.net/0z9mbp4r/ <tr> <td>11</td> <td><a data-toggle="modal" data-target="modal10">Miscellaneous Title</a></td> <td><p>C+</p></td> <td><i class="fa fa-sta ...

Improve the way you manage the active selection of a button

ts isDayClicked: { [key: number]: boolean } = {}; constructor() { } setSelectedDay(day: string, index: number): void { switch (index) { case 0: this.isDayClicked[0] = true; this.isDayClicked[1] = false; this.isDay ...

What's preventing vh from functioning in Chrome, yet it's fully operational in Internet Explorer?

Currently, I am utilizing vh for my project, which as far as I know represents 1 percent of the view height of the page. This measurement should function similar to percentages, especially with borders and potentially other elements. However, when I tested ...

How do you feel about sharing HTML files online?

I have a project in .NET 2.0 where I am creating a control that allows users to input HTML into a textarea and then upload it. The issue is that .NET requires me to set ValidateRequest=false on the page for the upload to work, which can potentially creat ...

Can the parent element containing this floated div also have text wrapping around it?

Hello there, I've been following along with this tutorial on CSS Positioning to enhance my understanding: . Everything was going smoothly until I reached step 7 and ran into a roadblock. In that step, the text "id = div-1" is supposed to be positioned ...

Is there a way to execute server-side functions with HtmlService?

I am currently learning programming and I'm experimenting with setting up buttons using jQuery in Google Apps Script. I have a spreadsheet with a menu that opens a dialog box created with HtmlService. Inside the dialog box, there are two buttons - o ...

Changing the placement of navbar components in Bootstrap 4 based on screen size

Through the use of Bootstrap 4, I have successfully created a navbar that collapses into a button when the screen size decreases. However, I am facing an issue where one item (the icon image) gets centered while the rest of the items are aligned to the lef ...

jQuery not functioning properly when attempting to add values from two input boxes within multiple input fields

I am facing an issue with a form on my website that contains input fields as shown below. I am trying to add two input boxes to calculate the values of the third input box, but it is only working correctly for the first set and not for the rest. How can ...

Listener of events that is modifying the incorrect label

Here's a JSfiddle link for you to check out. JS fiddle I am currently attempting to build a quiz using JavaScript, where the questions and answers will be sourced from JSON data. checkbox.addEventListener('change', function() { i ...

Extend the right column in a grid layout to vertically overflow at the same height as the left column using CSS

Is there a simple way to use CSS to ensure that the second column, which will contain a lot of text, overflows vertically at the same size as the left column image tag? The image changes size based on the window size (responsive) using the Bootstrap grid ...

Conceal multiple divs at the same time based on their largest dimension

I am facing an issue with two divs, each containing two nested divs: https://i.sstatic.net/QFMiU.png <div class="hide"> <div> Variable size </div> <div> Text1 (also variable size) </div&g ...

Show and conceal a search container with jQuery

I am in the process of designing a website that features a search icon within the navbar. When the user clicks on the search icon, it should disappear by applying the "hide" class to itself. Additionally, the hide class should be removed from a separate se ...

Show data from html input using PHP

Here is the HTML and PHP code I have been working on. I am trying to display the inputted data, but I am not getting any output. Can you help me identify what is wrong with my code? HTML <form action="welcome.php" method="POST"> <fieldse ...

Adjust the position of the image on the webpage to move vertically across the screen based on the

I am currently working on a project where I want to create an effect that moves an image from the top of the document to the bottom based on the scroll percentage. When the site is loaded, the image will start at the top and gradually move down as the user ...

Utilizing ElementRef in Angular 4 to close dropdown when clicking outside of it

I recently came across this helpful tutorial, but I'm having trouble grasping how it actually functions. Here's the code snippet I've incorporated into my TypeScript file: @Component({ host: { '(document:click)': 'onOuts ...

Update the query string to accommodate several values

Having an issue with my query string. Whenever multiple values are selected, my Django search function malfunctions. The URL displays ?Query=value1&Query=Value2, but only the last value is actually searched. I need both values to be searched using an A ...

What is the mechanism behind the functionality of padding percentage?

HTML <div class='container'> <div class='boxContainer'> The text inside this box should be centered vertically </div> </div> CSS .container { position: relative; height: 300px; wid ...

Modifying jQuery CSS causes certain CSS rules from a file to be deleted

When using jQuery to change the css of an element, I've noticed that it can remove some previously specified css rules for that element. For example, .className, .className2, etc... { background-color: black; color : silver; } .className: ...

Unveiling the hidden: Leveraging Python to extract elements not visible in HTML, yet present in Chrome's "Inspect Element" tool

Hello Python Experts! I'm diving into the world of Python and working on a program to retrieve data from a webpage. If the page returned all the information in its HTML source, there wouldn't be an issue as it's easily viewed in Chrome. Howe ...