Tips for adjusting height responsively with Bootstrap 4

Utilizing bootstrap to create div elements. Check out the fiddle link below:

fiddle

  • On my page, I have 4 divs - two on top and two at the bottom. The height of all 4 card divs should remain the same and not change.

  • In the last div, there could be one, two, or three nested divs. The maximum number of nested divs will be three.

  • If there is only one nested div, its height should be 100% the same as the first 3 divs.

  • In the last card, if there are two nested divs, they should each occupy 50% and have a scroll function. For three nested divs, each should occupy (100% / 3).

  • Only the last card's height should automatically adjust based on the number of nested divs within it.

Seeking assistance on how to achieve this using AngularJS for the front end. I have a flag "totalcount" that provides the count of nested divs. How can I set the height accordingly?

/* Latest compiled and minified CSS included as External Resource*/

/* Optional theme */
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');

body {
    margin: 10px;
}
.row{
  border:1px solid black;
  padding:10px;
}
#responseData{
  display:inline-block;width:40%;border:1px solid red;padding:3px;
}
#responseDataa{
  display:inline-block;width:40%;height:45px;border:1px solid red;padding:3px;overflow:auto;
}
<div class="container">
    <div class="row">
        <div class='col-md-12'>
          <div id="responseData">
          Why do the divs stack on top of each other when the line gets long? Shouldn't they be side by side due to the display property being set to inline-block?
          </div>
          <div id="responseData">
          Why do the divs stack on top of each other when the line gets long? Shouldn't they be side by side due to the display property being set to inline-block?
          </div>
           <div id="responseData">
          Why do the divs stack on top of each other when the line gets long? Shouldn't they be side by side due to the display property being set to inline-block?
          </div>
          
           <div id="responseDataa">
          Why do the divs stack on top of each other when the line gets long? Shouldn't they be side by side due to the display property being set to inline-block?
          </div>
           <div id="responseDataa">
          Why do the divs stack on top of each other when the line gets long? Shouldn't they be side by side due to the display property being set to inline-block?
          </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

What is the best way to make an input text the focus when an item on a dropdown menu is clicked?

I have a website with a dropdown menu and an input box. I want the user experience to be more seamless by automatically focusing the mouse cursor inside the input box when they click on an option in the dropdown menu. This way, users can start typing right ...

Converting a React element using JSON.stringify results in transforming it into a JavaScript object

I have an element in React called testReactElement that I want to display on the screen. I also want it to persist even after the user closes the tab and opens it again, so I decided to store it in localStorage. To add a React element to localStorage, I fi ...

Having an issue with fastify-multer where request.files is coming back as undefined during testing with Postman

In the process of developing an API that consumes multipart/form-data using fastify, I've integrated the fastify-multer plugin to handle file uploads for passing them to another third-party API. Currently, I'm testing with Postman, but encountere ...

Retrieving data from a database in PHP and assigning it as the value for an HTML select tag

Seeking assistance on a project to develop a stock management system for an herb factory using PHP with a MySQL database. Currently working on a page that allows the user to edit the value of a bench containing herbs. The bench details have been stored in ...

I encountered a data discrepancy while attempting to link up with a weather API

This is my debut app venture utilizing node.js and express for the first time. The concept behind this basic application involves connecting to an external API to retrieve temperature data, while also allowing users to input their zip code and feelings whi ...

Retrieve Gravatar image using JSON data

I am currently working on extracting data to show a user's Gravatar image. The JSON I have is as follows: . On line 34, there is 'uGava' which represents their gravatar URL. Ideally, it should be combined with / + uGava. Currently, I have ...

Animating lines with JQuery beneath navigation links

Currently in the process of revamping my portfolio website, and it's still a work in progress. Recently stumbled upon a jquery tutorial that enables a line to animate under anchor elements on hover, which I find quite intriguing. However, I am facing ...

the language of regular expressions expressed in strings

As a beginner in Javascript and regular expressions, I found myself stuck on how to create a route that matches all URLs starting with /user/.... Initially, I thought of using app.get(/user/, function(req, res){ /*stuff*/}); However, curiosity led me to ...

Encountered an issue while compiling code using the Istanbul plugin

I'm currently working on generating a code coverage report for my ReactJS project using the babel-istanbul-plugin. However, when I incorporate "istanbul" as a plugin in my .babelrc file and attempt to build, I encounter the following error: ERROR in ...

What is the process for creating a multi-word argument?

Is there a way to create multi-word arguments, such as reasons for bans or mutes? Currently, I am using args[2], args[3], args[4], args[5]... but this approach is limited and if nothing is written in those arguments, it will display "undefined". If you k ...

Retrieve the selected value from a radio button

I am attempting to display the chosen value in an input field when a radio button is selected. However, the functionality seems to be broken when I include bootstrap.min.js. You can find the code on JSFiddle. $('input:radio').click(function() ...

When the class changes, V-for re-renders every component

Currently, I am in the process of changing classes for images based on their index using the moveIndex method and key events. While this works smoothly on computers, it seems to take significantly longer when implemented on TVs. The process runs smoothly w ...

Save the content of the textbox on the webpage automatically, no need for a webservice or settimeout

Is there a way to save the text entered in a textbox on a webpage automatically, without relying on a webservice or the settimeout function? Any help would be greatly appreciated.Thank you in advance. ...

Visit a webpage on my site

Is it feasible to embed a website within another website? Suppose I have my index.html file. What if in the center of that file, we include an iFrame or similar element that loads , allowing users to explore Google directly on my website? ...

What is the meaning of '=>' in typescript/javascript?

I keep coming across lots of '=>' in the code I found on the internet. Could someone please explain it to me as if I were 5 years old? (I'm searching for the specific code, and I'll share it here once I locate it).. Found it: ...

The UI gets all wonky when using ThemeRoller for jQuery

Currently, I am encountering an issue where I want to utilize ThemeRoller for implementing custom themes on my views. However, when I apply these themes, the interface ends up looking distorted, as shown in the images below: Before using ThemeRoller: Aft ...

Encountering a CastError in Mongoose validation where the value fails to cast to undefined

I encountered a forbidden message while attempting to save data into the database. CastError: Cast to undefined failed for value [ {"product":{"supplierId":{"undefined":"rfytr"}}}, {"product":{"supplierId":{"$empty":"rfytr"}}} ] at path "condition" ...

Is there a way to activate a function when clicking on the "View larger map" option within the Google Maps

I am currently in the process of creating a cordova application with ionic and angularjs, where I am using the google maps embed API to include a map within the app. https://developers.google.com/maps/documentation/embed/guide https://i.sstatic.net/TOd ...

What sets apart state management from utilizing $rootScope in AngularJS?

After using AngularJS extensively, I kept hearing the advice to not overuse $rootScope due to it being considered bad practice. When React introduced the Flux pattern, I noticed similarities to $rootScope with its centralized data management approach. If ...

What is the best way to use PHP to show a PDF in a new browser tab instead of downloading the file?

I am working on updating the code to change the action of opening a PDF file in a new browsing tab instead of downloading it locally. Can anyone provide guidance on how to make this update? public function openFileInNewTab($fileID) { $this->load-& ...