How can you grow the size of a collapsed Bootstrap 4 card?

Situation :

  • In this scenario, I have a section with a card, and
    when the card is clicked, it expands and displays additional information (card-block) simultaneously

Task at Hand :

  • I need to increase the width and height of the card when expanded,

    Here is the jsfiddle link: http://jsfiddle.net/Mwanitete/5bwryt1g/3/

    NOTE: The functionality may not work in jsfidle, but it works on my localhost


HTML Code :

<div class="card">
    <div class="card-header">
        <a data-toggle="collapse" href="#test-block" aria-expanded="true" aria-controls="test-block">
            card header
        </a>
    </div>
    <div id="test-block" class="collapse">
        <div class="card-block">
            card block
        </div>
    </div>
</div>

Current Status :

  • Currently, the card only expands and displays data without increasing its width and height.

What steps should I take to achieve the desired outcome?

Answer №1

Make sure to rearrange the order of Jquery.js so that it appears above bootstrap.js

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

<div id="test-block" class="collapse">
        <div class="card-body">
            card block
        </div>
    </div>

http://jsfiddle.net/5bwryt1g/8/

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

Angular animation not firing on exit

I am encountering an issue with my tooltip component's animations. The ":enter" animation is working as expected, but the ":leave" animation never seems to trigger. For reference, here is a link to stackblitz: https://stackblitz.com/edit/building-too ...

Determining the repetition and placement of background images when employing multiple backgrounds

Is it possible to apply two background images to the same div? I want one image to repeat along the x-axis and the other to appear only once. I've tried using multiple background images, but I'm not sure how to target specific rules for each bac ...

Tips on utilizing imacros for extracting image URLs

I am currently experimenting with the use of imacross for web scraping, but I have encountered a roadblock when it comes to extracting image URLs from markdown code like the one provided below. <div class="dpimages-icons-box"> <a href="http: ...

What are some methods to maintain consistent height for each list item in an unordered list on small screens like mobile devices?

While vh works well for larger screen sizes such as laptops, it may not maintain the height of the li on smaller devices like mobiles. Is there a better approach than relying on media queries to achieve responsiveness across different screen sizes? ...

Having trouble loading Yeoman Webapp SASS

Every time I try to build a web application using 'yo webapp', I encounter a 404 Error. GET http://localhost:9000/styles/main.css 404 (Not Found) I removed compass from the project, but that shouldn't be causing the issue, correct? ...

Automatically adjusting the image size based on the height of the window using CSS

While this question may seem trivial, any help would be greatly appreciated. I am faced with the task of adjusting a massive image to one-third of the window's height using CSS. It is important that I maintain its width proportionally. If possible, I ...

Discovering the pressed submit button in Node.js: A beginner's guide

How can the controller or admin determine which submit button was pressed in a form like this? <form method="POST"> <input type="submit" value="Add Admin" name="addAdmin"> <input t ...

What is the best way to arrange buttons in a row horizontally?

Desired Output I need help aligning the buttons as shown in the Desired Output image, but when I run the code, the buttons stack vertically, resulting in Output like this. I've included the HTML, CSS, and JS code below. As a beginner in UI design, I ...

The slider text is not getting updated when onclick() is triggered

My project involves a map with a slider that adjusts the display of points as you slide from year 1 to year 10. Some of these points are filtered based on certain parameters linked to 4 buttons. The issue I'm facing is that when sliding the slider a ...

Utilize the Slick carousel to display varying numbers of slides at different screen sizes

Currently, I am utilizing slick.js to create a responsive carousel. However, I am facing an issue with the breakpoint set at 980px, where I intend to display only two slides instead of three. Despite adjusting my code, it does not seem to work as expected. ...

The Bootstrap dropdown menu experiences a flickering issue when the user quickly hovers over it

I currently have a bootstrap menu implemented on my website. When the user hovers over any item in the navbar, a dropdown is displayed, and within that dropdown, there are sub-items as well: https://i.sstatic.net/6XdgR.png As shown in the image. <l ...

Alignment issue with column headers in Bootstrap Table

https://i.sstatic.net/nKtgx.png <table class="table"> <thead> <tr class="d-flex"> <th class="col-0">JOB ID&l ...

Bx slider - displaying partially hidden slides at the far right while utilizing a full-width carousel

Implementing a slider on my nodejs website using bx slider has been quite an experience. Below is how I achieved it: $(document).ready(function(){ $(".bxslider").bxSlider({ minSlides: 1, maxSlides: 40, slideWidth: 300, ...

The checkbox is not updating as anticipated

I'm currently developing a basic widget that allows the user to change the value of either the check box OR the entire div by selecting them. Below is the code I have implemented: $(document).ready(function() { $(document).on("click", ".inputChec ...

Hit the jackpot by guessing the word PHP!

I recently developed an application for a local radiostation that features a word guessing game with a Jackpot. Upon entering the page, $message displays the current amount of the Jackpot. The Jackpot increases by 5 every time someone incorrectly guesses t ...

Initial Blazor Navbar Display Issue

I'm currently working on a Blazor learning project and encountered an issue with the navbar after installing Blazorise. The navbar is not showing up when I start the web app, but if I minimize Chrome, the navbar-toggler-icon appears. Clicking on the i ...

How can you change a particular inline style using the Firefox browser?

I am looking for a solution to override an inline style on a specific webpage within the Firefox browser without access to the source code. Previously, I would manually modify the page source using Firefox development tools. Specifically, I encounter a we ...

Can anyone explain why I am having trouble loading JavaScript files into a different HTML file?

Currently, I am developing an electron application. In my index.html file, I have successfully loaded JavaScript files in the head tag and can access the JS functions without any problems. Now, I have created a separate browser window with another HTML fi ...

Personalize the menu item in material ui

Currently, I have a <select> component from Material UI and I am iterating over the menuItem elements. Here is a sample you can reference: here My issue lies in trying to change the background color of each menu item. Although I attempted to do so, ...

Ways to verify an iCheck located on the following page

Here is the code snippet I am currently working with: $("#add-new-size-grp").click( function (event) { event.preventDefault(); $.ajax({ type: "get", url:"ajax-get-sizes.php", success: function(result){ $("#sizeg ...