Enhance card design by adjusting appearance based on container size in Bootstrap

I need to display different views of cards depending on the size of the device. The card style should adjust according to the width of the container. For larger devices, I have the following card style:

<div class="col-lg-3 col-md-4 col-sm-6 portfolio-item">
      <div class="card h-100">
        <a href="#"><img class="card-img-top" src="http://placehold.it/700x400" alt=""></a>
        <div class="card-body">
          <h4 class="card-title">
            <a href="#">Project One</a>
          </h4>
          <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet numquam aspernatur eum quasi sapiente nesciunt? Voluptatibus sit, repellat sequi itaque deserunt, dolores in, nesciunt, illum tempora ex quae? Nihil, dolorem!</p>
        </div>
      </div>
    </div>

And for medium and small devices, I require the following layout:

<div class="row">
    <div class="col-md-7">
      <a href="#">
        <img class="img-fluid rounded mb-3 mb-md-0" src="http://placehold.it/700x300" alt="">
      </a>
    </div>
    <div class="col-md-5">
      <h3>Project One</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam exercitationem expedita laborum at voluptate. Labore, voluptates totam at aut nemo deserunt rem magni pariatur quos perspiciatis atque eveniet unde.</p>
      <a class="btn btn-primary" href="#">View Project</a>
    </div>
  </div>

I am looking for suggestions on how to achieve this efficiently. Any guidance would be appreciated!

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

Tips on positioning a div with bootstrap 5?

Is it possible to place multiple divs one after another in various directions, similar to the design shown in this image: https://i.sstatic.net/HkMKG.png Are there any specific Bootstrap components that can achieve this exact design? Any design ideas you ...

Update the div element without needing to reload the entire page

Is there a way to reload a div tag without refreshing the entire page? I understand this question has been asked before, but I want to make sure I have a clear understanding. <p>click HERE</p> <div class="sample"> <?php functi ...

What is the best way to eliminate the empty space at the bottom of my Bootstrap site?

Help needed with my Bootstrap webpage! I'm encountering an issue where there is a 5px gap at the bottom of my page that I can't seem to get rid of. I've tried adjusting the margins and padding to no avail. Any suggestions on how to fix this ...

Center the div vertically aligned with the following element

Seeking guidance on aligning an element to the vertical center of another element. https://i.sstatic.net/Hk8UE.png In the provided scenario, the goal is to align the top of text with the vertical center of the adjacent image. https://i.sstatic.net/hxmm9 ...

Positioning JQuery sliders

I've been working on a jQuery slider for my header, but I'm encountering an issue where the previous image drops down to the next container instead of staying in place and transitioning smoothly. It seems like there might be an error in my HTML/C ...

Ways to avoid text covering the button using CSS

Take a look at this image: https://i.sstatic.net/U7wGV.png In the image, you can see that I have entered text in the input box. However, since there is also a button placed inside the box, the text gets hidden behind it. Is there a way to prevent this i ...

"Header not displaying in Internet Explorer due to HTML/CSS compatibility issues

Recently, I launched a new website with a navigation element that overlaps the header image. Unfortunately, in Internet Explorer (all versions less than 10), both the header and navigation disappear completely. Everything coded using traditional row-by-row ...

Prevent jQuery UI dialog from adjusting its position relative to the browser when scrolling

When I launch a jQuery UI dialog, the position of the dialog changes when I scroll the browser. How can I make it remain in the same position relative to the browser window? ...

Compatibility Problem with Form Inputs in Internet Explorer 7 when Using a jQuery Datepicker

I've encountered a frustrating issue with my Reservations area (jquery ui datepicker) on the site I'm currently working on. When viewed in IE7, the datepicker is broken and displayed on separate lines. If you'd like to check it out yourself ...

The alignment of the Bootstrap Radio white circle is off when adjusting the HTML font size

I'm currently working on a simple web application using Bootstrap for styling. While I really like the overall look of Bootstrap, I've run into an issue with the appearance of my radio buttons when I adjust the font size in my HTML. Here is a sn ...

What's causing these flex items to not wrap around properly?

I'm facing an issue with a flex item that also acts as a flex container, .sub-con. The problem is that the flex item within .sub-con is not wrapping even after applying flex-flow: row wrap. Is there anyone who can help me resolve this problem or iden ...

How can I retrieve the height of a dynamically generated div in Angular and pass it to a sibling component?

My setup consists of a single parent component and 2 child components structured as follows: Parent-component.html <child-component-1 [id]="id"></child-component-1> <child-component-2></child-component-2> The child-compo ...

Expanding image in Bootstrap carousel

Having difficulty with the sizing of my carousel image slider in bootstrap. Tried adjusting image height using inline css, but images remain stretched. <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> < ...

What is the best way to get rid of a Bootstrap modal?

Currently, I am working on a small application to enhance my knowledge of AJAX and JavaScript. Within this project, I have implemented a method called saveData() which is activated upon clicking a 'save' button. Everything seemed to be functionin ...

What steps should I take to create my own category organizer?

Currently, I am in the process of creating a category organizer for my website. Radio buttons can quickly become overwhelming, while select/option buttons are not very noticeable. After some searching, I came across this unique category organizer and I am ...

Tips for expanding the width of Bootstrap modal using animation

Is there a way to resize my Bootstrap 5 modal width and add an animation effect when it expands? I've tried using animate and transition in my style-css but haven't had any success so far. I've looked at other solutions online, but none seem ...

What is the best way to position three divs next to each other in a row?

I have three divs with widths of 200px, 300px, and 200px. How can I align them side by side? Most examples only show how to do this with two divs. Div1 and Div2 are working correctly, but for some reason, Div3 is sliding under Div1 like in the picture belo ...

How can I align text to the bottom right and left corners at the same time?

Is there a way to align text so that it appears in both the bottom right and bottom left corners of the page, functioning as a footer? For example: JANUARY (bottom left corner) / 2019 (bottom right corner) If anyone knows how to achieve this using HTML ...

Getting user input with JQuery and dynamically updating CSS properties

<img src="purplemoon.png" alt="Purple moon" id="moon-photo" /> <table> <tr> <th colspan="4">Control panel</th> </tr> <tr> <td> <!-- attempting to retrieve value from the input field ...

Sorting `divs` based on the number of user clicks in JavaScript: A simple guide

I've implemented a script that tracks the number of clicks on each link and arranges them based on this count... Currently, everything is functioning correctly except when the <a> tags are nested inside a div. In such cases, the script ignores ...