Resizing Bootstrap Thumbnails for Lengthy Titles

Utilizing the class="thumbnail" and class="caption" features from bootstrap to create these presentations.

An issue arises when the Title extends by 1 row for one of the cards, causing it to become larger and disrupt my col-md-3 or col-md-4

How can I ensure that all cards maintain the same size even if the Title extends onto two rows?

Observe how the height increases as the title becomes longer

Thank you!

https://i.sstatic.net/470zd.png

Answer №1

To shorten your title, follow this example:

$('button').on('click', function() {
  $('p').toggleClass('ellipses');
});
.ellipses {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container" style="width:120px">
  <button>Toggle Ellipses</button>
  <p class="ellipses">For more information, please visit: http://csstricks.com/thisisanonexistentandreallylongurltoaddtoanytextinfactwhyareyoustillreadingit.</p>
</div> 

Answer №2

To implement Flexbox in your project, refer to this guide: . Make sure to check the browser compatibility for proper usage. For more insights on utilizing Flexbox Grids, visit:

For a practical demonstration, take a look at this example:

Answer №3

The mechanics of Bootstrap are quite challenging and unfortunately, there is no built-in solution to address this issue.

To tackle this problem, you have a few options:

  1. Set a fixed height for the title block or the entire container.

  2. Determine the height of the tallest container and use JavaScript to apply this height to all containers.

  3. Alternatively, you can explore using JavaScript libraries to create visually appealing mosaic grids, such as this. One popular library for this purpose is Masonry.

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

Problem Encountered with Position Absolute in Bootstrap 3

Could you please review this demonstration and advise me on why I am encountering issues when trying to set up an absolute position on the first row? Thank you. html, body { height: 100%; } .element{ position:absolute; top:0; } .one{height:500px; backgro ...

Manipulating class properties in AngularJS from a controller

I won't dwell on the reason for this (it's required to override some behavior in Angular Material that is causing issues in Safari), but here is what I am attempting to accomplish: HTML: <style> .changeme{ height: 300px; } </st ...

What is the best approach to transforming my jQuery function into CSS to ensure responsiveness?

I have created a jQuery animation with four functions named ani1(), ani2(), ani3(), and ani4(). Everything is working fine on desktop, but now I am facing the challenge of making it responsive for mobile devices. I am looking for CSS code to replicate the ...

Exploring the dynamic animation of jQuery slideDown with the layout manipulation of

My current project involves using an HTML table with multiple rows. I have hidden every second row, which contains details about the preceding row, using CSS. Upon clicking the first row, I am utilizing jQuery's show() function to display the second ...

Determining the window height using jQuery when overflow is set to hidden

I've built a full screen web application that I don't want to scroll, so I used this code: $("body").css("overflow", "hidden"); However, after adding a resize listener: $(window).resize(function(){ console.log("Inner height: " + $(window). ...

Challenges with Javascript slideshow using arrays

As a newcomer to Javascript, I am facing a challenge with this particular issue. The objective of this script is to rotate through 3 different combinations of text (slide) and images (slideimg) when the previous and next buttons are clicked. Currently, m ...

What is the best way to display multiple quotes from my generator at once?

I'm seeking assistance with my quote generator. It functions correctly in JS Bin, generating the specified number of quotes when output to the console log. However, once integrated into an HTML page, it only generates one quote regardless of user inpu ...

The background image went missing after the webpack build due to the absence of the id svg-path.svg

I am currently using Next.js. My styles look like this: .img { background-image: url(path/to/my/svg/file.svg#icon); } However, when I run npm run dev, the styles for my element with the class name "img" change to: .img { background-image: url(pat ...

I'm curious to know why my jQuery function fadeOut is functioning properly while slice isn't working as expected

I'm trying to create a button that displays three consecutive posts After clicking on "view all", the three "div" elements should become visible I'm attempting to use jQuery to make the three 'div' elements appear when the view all bu ...

The <transition> element is not being recognized by VSCode

It seems like my VSCode is highlighting the transition element in red, indicating that it may not be recognizing this element. I'm a bit perplexed by what's happening here. Moreover, the code isn't functioning as expected because there is no ...

Attempting to trigger the onchange function established by jQuery

Within my code, I have a change listener set on the checkboxes in this section: $(".section").change(function() { if($(this).is(":checked")) { $("." + this.id).show(); ... Now, I am attempting to simulate a click event on the ch ...

Troubleshooting Django's For Loop Execution Problem

My django for loop is designed to insert items within a form tag. However, the issue arises when the code runs and only the initial item is placed inside the form, while subsequent items are positioned outside the form html element. This is the code snipp ...

Conquering Bootstrap 3's Image Gallery Customizations

I am currently working with Bootstrap 3 RC1 and struggling to set up the image gallery properly. Issue 1 - The ul is adding unnecessary padding-left or margin-left. What do I need to do to eliminate this? Issue 2 - Each li is extending across the contain ...

Add a font awesome icon dynamically using JavaScript

I'm currently working on a navigation bar in JavaScript that displays the titles of various links. However, I would like to enhance it by adding small icons next to the text. Can anyone guide me on how to integrate Font Awesome icons into my JavaScrip ...

How can one guide a glTF model in the direction it is pointed using A-frame?

I have a 3D model of my customized robot loaded in an A-frame scene using version 1.0.4. Currently, I am able to rotate the robot along its x, y, z axes, but I am facing an issue where it continues to move in its original direction rather than the one it i ...

Rapid HTML coding dilemma

Currently, I am in the process of quickly marking up my webpage. One issue I am facing is that I would like my title to be displayed below my <nav> tag instead of beside it. Can anyone provide guidance on how to achieve this? Here is the current HT ...

CSS: Position an element based on the size of the screen

I'm currently developing a program that will dynamically resize elements based on the viewer's screen size. The program is being built using JSP/SQL/XHTML/CSS, and I have a couple of queries. Is there a way to select a CSS file by storing the sc ...

"Revamp Your CSS Styles with RTLCSS and Elevate Your Vue Js Project

Because Element Plus does not support Right-to-Left (RTL), I had to utilize third-party libraries such as the rtlcss plugin to address this issue. However, in my application where both RTL and Left-to-Right (LTR) directions are used, the rtlcss plugin alwa ...

Tips for displaying the CSS3 background image on your website

My website is not displaying the background-image with the URL img/hero.jpg. I attempted using ../img/hero.jpg but still no success. Are there any solutions to this issue? I also experimented with a PDF image, but it did not work either. ...

What is the best way to display a page within a div without having it covered by the header and footer elements?

Currently working on customizing a WordPress website. Within my main document, I have the code set up for the header and footer, with a div in between for displaying content. My goal is to have the ability to show content from navigation links clicked wi ...