Ensuring consistent column heights in Bootstrap across all devices

There is an HTML element containing an image and text positioned side by side using Bootstrap. Here is the code:

<div class="row">
  <div class="col-md-6">
    <div class="avatar">
      <img src="<?= get_template_directory_uri(); ?>/dist/images/weare.png" alt="" class="img-responsive">
    </div>
  </div>
  <div class="col-md-6">
    <blockquote>
      <h1>Title</h1>
      <p>Text.</p>
    </blockquote>
  </div>
</div>

The issue arises when viewing the design on a small screen where the image does not take up the full canvas size.

https://i.sstatic.net/jqD6M.png

On a large screen, the text box appears way too large.

https://i.sstatic.net/fMkf6.png

Looking for a way to maintain a fixed height on all screen sizes, I am seeking help with adjusting the Bootstrap and flexbox properties.

Answer №1

Give This a Shot

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>


<div class="row p-2">
  <div class="col-md-6">
    <div class="avatar"> <img src="https://preview.ibb.co/iQEpfb/Kuli_Postcard_STPATTYS2016_750x500_vz.png" alt="Kuli_Postcard_STPATTYS2016_750x500_vz" border="0" class="img-responsive"> </div>
    </div>
  <div class="col-md-6">
  <blockquote>
    <h1>Title</h1>
    <p>Paragraphs are the essential elements of written work. Many individuals determine paragraphs based on their length, such as a paragraph constituting a minimum of five sentences or half a page. However, the true essence of a paragraph lies in the cohesion and coherence of ideas among sentences. Therefore, paragraphs serve as the foundation of written pieces, binding thoughts together into a unified whole. </p>
  </blockquote>
</div>



<div class="row p-2">
  <div class="col-md-6 ">
    <div class="avatar"> <img src="https://preview.ibb.co/iQEpfb/Kuli_Postcard_STPATTYS2016_750x500_vz.png" alt="Kuli_Postcard_STPATTYS2016_750x500_vz" border="0" class="img-responsive"> </div>
    </div>
  <div class="col-md-6">
  <blockquote>
    <h1>Title</h1>
    <p>Paragraphs are the fundamental components of literary works. Many students associate paragraphs with a specific length, like a group of at least five sentences or half a page. However, the coherence and unity of ideas within sentences truly define a paragraph's essence. Therefore, paragraphs play a crucial role in structuring written compositions, ensuring a logical flow of ideas. </p>
  </blockquote>
</div>

Answer №2

 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
       <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
        <div class="container-overflow-wrap">
    <div class="container">
        <div class="hidden-xs">
            <div class="row row-padded row-bordered row-centered">
                <div class="col-sm-6">
                    <div class="avatar">
                        <img src="https://www.w3schools.com/css/img_fjords.jpg" alt="" class="img-fluid">
                    </div>
                </div>
                <div class="col-sm-5 col-sm-offset-1">
                    <blockquote>
                        <h1>hi this a demo</h1>
                        <p>The Moon is a barren, rocky world without air and water. It has dark lava plain on its surface. The Moon has filled with craters. It has no light of its own. It gets its light from the Sun. The Moo keeps changing its shape as it moves around the Earth. It spins on its axis in 27.3 days stars were named after the Edwin Aldrin were the first ones to set their foot on the Moon on 21 July 1969 They reached the Moon in their spacecraft named Apollo II</p>
                    </blockquote>
                </div>
            </div>
        </div>
    </div>
</div>

give it a try, it might be useful

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 data-ng-bind directive cannot be used with the <option> tag

Currently, I am in the process of learning angular and encountered a problem that has me stuck. Upon researching on AngularJS : Why ng-bind is better than {{}} in angular?, I found out that both {{}} and ng-bind are said to produce the same result. However ...

Is it possible for us to customize the angular material chip design to be in a rectangular shape

I recently implemented angular material chips as tags, but I was wondering if it's possible to customize the default circular design to a rectangle using CSS? ...

What is the best way to overlay text onto a background image using Material UI's Card and CardMedia components?

Using the card component, I have successfully added a background image. However, I am facing difficulty in figuring out how to overlay text on top of this image. If anyone has suggestions or alternative methods, please feel free to share! <Card> ...

Leveraging Polymer web components without the need for a package manager

I am looking to incorporate web components into a static web page without the need for any package manager or JavaScript build process. After referencing , I attempted to import them using unpkg by changing <script type="module" src="node_modules/@pol ...

When is the best time and place to break out Yahoo's Mojito Manhattan cocktail mix?

Yahoo! made headlines earlier this month by unveiling their new Mojito framework, set to be open sourced in 2012. I've been eager to learn more about this promising framework but haven't had any success so far. Does anyone know where I can find ...

What is causing the action button in my MUI snackbar to occupy an additional line?

I'm currently learning how to use MUI and I'm struggling with a specific issue. The close button in my code is appearing on a separate line, but I want it to be on the same line as the word "again". I've tried experimenting with absolute pos ...

Troubleshooting a mysterious anomaly with a jQuery UI button

Would like to achieve something similar to this: http://jqueryui.com/demos/button/#icons When trying to replicate it, http://jsfiddle.net/p5PzU/1/ Why is the height so small? I expected a square shape but am getting a rectangle instead. What could be c ...

Can you suggest some unconventional HTML/CSS attributes and tools for arranging a form in a way that results in a unique tab order?

As part of my role, I am tasked with transforming mock specs provided by our clients into custom web forms. Our application comes equipped with tools specifically developed to streamline this process. Recently, I was presented with a particularly intriguin ...

Is it possible to use font-face in CSS3 to switch fonts for different languages?

Can I replace an Arabic font with a custom one using font-face in CSS3? I've successfully done it with English but I'm not sure if it's the same for foreign languages, so I wanted to check. Also, I feel silly asking this question, but I&apos ...

Is OpenLayers + Ajax causing issues or errors?

Utilizing the code provided below to showcase an OpenLayers map within a DIV container presents a peculiar issue. Upon initial load of the webpage, the map does not display consistently - requiring multiple page refreshes in order for it to become visible. ...

Content move to the left with Material UI's shifting capabilities

Is anyone experiencing an issue with Material UI dropdown Select and Modals causing the content to shift to the left? I attempted using position: absolute on both the Select element and MenuItems, but unfortunately the content still shifted. Has anyone e ...

Creating a button for every individual row within a table using a combination of PHP and HTML

I need assistance with my current PHP and HTML code that generates buttons on each table row: <!DOCTYPE HTML> <h2 class="text-center">Consulta</h2> <br> <table class="table table-striped"> <tr class="in ...

What is the proper method to deactivate a hyperlink in Angular 2?

I'm currently developing a web application using Angular2, and I find myself in need of displaying, but making it non-clickable, an <a> element within my HTML. Can anyone guide me on the correct approach to achieve this? Update: Please take no ...

Utilizing document.write to switch up the content on the page

Every time I attempt to utilize document.write, it ends up replacing the current HTML page content. For instance, consider this HTML code: <body> <div> <h1>Hello</h1> </div> and this jQuery code: var notif = document. ...

After applying 'all: unset;' to remove all styles, the CSS hyphens property does not work as expected in Chrome

After applying this CSS code to remove all styles: * { all: unset; display: revert; } The issue arises in Chrome browser where CSS Hyphens are not taking effect. This can be seen with the following example: div { font-size: 3rem; -webkit-hy ...

Issues with Laravel 8's datatable scripts causing dysfunction

In my practice with the AdminBSB template, I am facing an issue where the Jquery datatable plugin JS is not functioning properly in my blade template. I aim to achieve a datatable layout similar to this example: https://i.sstatic.net/krfPl.jpg However, t ...

Step-by-step guide on creating a blank horizontal line in an HTML table

Can anyone help me figure out how to draw a horizontal line connecting from td 1 to td 4 without relying on content CSS? I'm envisioning a progress bar like the one shown in the following image: https://i.sstatic.net/on8Bi.png <table> < ...

Encasing extracted content in <p> tags

On my Wordpress Site, I have extracted images and text separately to use in different sections of my single.php file. Utilizing HTML within the Bootstrap 3 framework: <div class="row"> <div class="col-md-12"> <?php ...

Attempting to establish a means to switch between languages

Currently, I am in the process of implementing a language switch feature for a website project that I am currently working on. This feature will allow users to seamlessly switch between English, Latvian, and Norwegian languages. To achieve this functionali ...

"Enhance User Experience with the jQuery/JavaScript Table Pagination

I have searched extensively for a jQuery/JavaScript table pagination solution. While I found some options, they were too complex for my needs. I am looking for a simple jQuery plugin to assist with paginating an HTML table. Datatables is more than what I ...