Achieving consistent alignment within table rows of divs with varying heights using a fluid layout - CSS

Currently, I am developing a mobile site with a fluid layout. The main page features a table that displays several products.
Within each product, there are 3 divs: product-image, product-name, and prices-container.
I'm faced with the challenge of aligning the prices-container div horizontally across the table rows.
Two possible solutions come to mind: either make product-name match the height of the tallest one in the table row, or have prices-container stick to the bottom of the product's table cell. However, implementing either approach has proven difficult for me.

For a visual representation of the issue, take a look at this illustration. The left image depicts the current problem, while the right image shows the desired outcome.

The crux of the problem lies in the fact that the height of product-name varies due to dynamic text content. It could span from just one line to several lines.

I've set up a CodePen demo for you to review my code and better understand the issue >> Check it out here << (Please excuse the unsightly background colors, they're used for troubleshooting purposes).
My HTML is written in Jade, and my CSS is stylized using Stylus.

Here are the limitations:
- Solution must rely solely on CSS & HTML, without involving JavaScript
- Design should accommodate fluid layouts (width defined by percentage)
- Avoid setting a fixed height for product-name since it contains variable text

If you have any innovative ideas on how to tackle this challenge, I would greatly appreciate your input! Thank you! :)

Answer №1

Include the vertical-align:bottom; CSS property in the .box1 class. Also, apply this style to the .box4 CSS class. Thank you.

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

How to retrieve data from a JavaScript array in a separate JavaScript file

In my checklistRequest.js file, I populate an array and then try to access it in my Termine_1s.html file, which includes JavaScript code. Although I can access the array, when I attempt to iterate through it, only single digits are returned instead of stri ...

The link button became unresponsive as soon as I implemented CSS changes

I customized one of my buttons with special styling, and now I'm facing an issue where the button is clickable but it fails to direct me to the intended link (which should open a YouTube video in a new tab). #help { background-color: cornflowerbl ...

The conversion of a newline in an Angular page is done using &lt;br/&gt tag

Here is a function I have: setLocalVariableOnAccepted(ogp, hb, responseJson) { if (responseJson.ofgp === undefined) { this.ogpStatus = 'orange'; this.ogpStatusMsg = responseJson.ofgp + ', <br/> No change. Previous va ...

Tips for creating inline links

Data is taken from a table using $number and printed as follows: echo "<div class='pagination'><a href='page_pagination.php?number=". $number ."' > ". $number ." </a></div>"; The output does not display in one ...

The background image fails to display on the button

Why isn't the background image for my button appearing when set using a CSS rule? I have a button with the class "todo" and although other parts of the rule work, the image itself does not show up even after trying "background: url" and "background-im ...

The functionality to organize items appears to be malfunctioning. (Javascript)

I want to add a price sorting feature that allows users to sort by either 'high to low' or 'low to high' using a drop-down menu. The products I want to sort are the w3-containers, each representing a different product. However, nothin ...

Switching JSON data when clicked in Angular 2

Looking for a way to dynamically switch between different data sets in JSON upon user interaction with UI buttons. I am utilizing Angular 2 framework for this task. The HTML structure is as follows: <button type="button" (click)="changeOdds('odds ...

When the parent element has a fixed position, the child element will no longer maintain its floating property

I'm currently working on a fixed navigation panel that sticks in place while scrolling down. Here is the code I have so far: <header> <a class="logo" href="/">Logo_name</a> <nav> <a href="#">Menu_1</a& ...

Vertically align the body of Bootstrap 4 cards with variable header line rows

I have a minimalistic design where I showcase products using cards. However, I am facing an issue where some product titles wrap onto 2 lines while others only wrap onto 1 line. My goal is to vertically align the body text (and price buttons as well). &l ...

The clash between React Inline styles and Client CSS can lead to conflicts in styling

Our application needs to be loaded into the client's page, which is built using React. We are implementing React Inline Styles by defining styles as objects. However, we have encountered an issue where any CSS specified by the client using tag attribu ...

How can I prevent my website layout from adjusting when the window is resized?

I want my website to remain the same regardless of window resizing, ensuring that no elements on the page shift or change size. Currently, my image and buttons are moving and resizing with the window, which I don't want. * { box-sizing: border-bo ...

Center unordered lists with varying numbers of items

I am currently facing a challenge while attempting to create four lists with different numbers of items and align them properly on my webpage. After applying inline-block to the ul class, I encountered issues with alignment as illustrated below: https:// ...

Customize the default email validator in AngularJS

I am looking to customize the email validator in AngularJS by using a custom string for validating email addresses. However, when I tried implementing the code provided in the documentation, it doesn't seem to work as expected. Here is the code snippe ...

The page you are looking for cannot be found (404) because the request method used was

When a seller clicks the button to sell an item, no one else should be able to make an offer after that. The winner must be clearly identified and can access their products on the product page as well as the winners page. The winners page follows a layou ...

Transmit data from Raspberry Pi to Apache Server with strong security measures

Utilizing a Raspberry Pi to collect temperature data and store it in a file Running on a virtual machine, the server uses Apache to host a website (comprised of HTML, PHP, and JavaScript) displaying a graph based on this data I am seeking a secure method ...

When the window size is minimized, containers are colliding with each other

On smaller window sizes or certain small screen phones, the buttons are overlapping the heading. Take a look at the code below: <style> body { font-family: Arial, Helvetica, sans-serif; } .x2 { position: absolute; left: 50%; top: 50%; tran ...

Incorporating URL-linked images within Django

Is there an easy method to insert images into URLs in Django similar to this example? <img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." /> I need to display multiple small images and I think this approach could b ...

I am facing an issue where the table in my Laravel Vue component is not displaying the data from

Recently, I've been diligently following an instructional series on VUE applications by a highly recommended YouTuber. Every step was meticulously executed until I hit a roadblock out of nowhere. The data from my database refuses to display on the fro ...

Ways to customize background color for a particular date?

I have been using the fullcalendar npm package to display a calendar on my website. I am trying to figure out how to set a background color for a specific selected date. I tried looking into this issue on GitHub at this link. However, it seems that dayRe ...

NavigateToTop/BackToTheBeginning

I'm facing a challenge with a page layout that involves two vertical div's - one for the menu on the left and another for loading content on the right. My goal is to utilize the .scrollintoview() function on the menu div so that when a link is cl ...