static footer within fluid identical div/columns

After conducting extensive research on the internet and exploring various Stack Overflow questions, I could not find a solution to my problem...

MAIN CONCEPT:
My challenge involves creating dynamic divs within the body of my webpage, each containing content sourced from a database. The number of divs can vary - it could be 3, 10, or even 32. These divs act as thumbnails, with varying content heights ranging from 4 lines to 8 lines. However, all these divs must have equal height. Currently, the layout looks like this: https://i.sstatic.net/g2qPh.png

WHAT I REQUIRE
As depicted in the image above, the "Category 1" and "Category 2" labels should always be at the bottom, irrespective of the content above them. By making some adjustments to the layout, you can see what I'm aiming for here: https://i.sstatic.net/N7l3U.png

I've attempted various approaches such as absolute and relative positioning, using display properties, setting 'bottom' values to 0px... but none of them have worked. Here's my current code (keep in mind that the content is dynamically generated), please review it and provide assistance:

HTML/JS:

<div id="container-cursos" class="center-block container-geral-cursos">
</div>

<scrip>
                    var courses = func.Courses;
                    var courseContainer = $("#container-courses");

                    for (var i = 0; i < courses.length; i++) {
                        var course = courses[i];       
                        var singleCourseContainer = document.createElement("div");
                        singleCourseContainer.addClass("web-col-responsive container-div-course");
                        courseContainer.append(singleCourseContainer);

                        var testDiv = document.createElement("div");

                        var courseImg = document.createElement("img");
                        courseImg.addClass("img-course-thumbnail img-responsive");
                        courseImg.onclick = this.ClickCourseCommand.bind(this, course);
                        courseImg.src = shell.Host + "/content/" + course.Image;

                        testDiv.append(courseImg);

                        var btnDescCourse = document.createElement("span");
                        btnDescCourse.onclick = this.ClickCourseCommand.bind(this, course);
                        btnDescCourse.addClass("course-title");
                        btnDescCourse.innerHTML = course.Description;
                        testDiv.append(btnDescCourse);

                        var modulesDiv = document.createElement("div");
                        modulesDiv.addClass("NOTHING");
                        modulesDiv.style.display = "inline-block";
                        testDiv.append(modulesDiv);


                        for (var y = 0; y < course.Modules.length; y++) {
                            var module = course.Modules[y];

                            var btnModuleDescription = document.createElement("span");
                            btnModuleDescription.addClass("col-xs-12 course-module-description");
                            btnModuleDescription.onclick = this.ClickModuleCommand.bind(this, course, module);
                            btnModuleDescription.innerHTML = module.Title;
                            modulesDiv.append(btnModuleDescription);
                       }
                        singleCourseContainer.append(testDiv);
                        var categoryCourseContainer = document.createElement("div");
                        categoryCourseContainer.addClass("container-category-course");                    

                        for (var j = 1; j < 3; j++) {
                            var categoryCourse = document.createElement("span");
                            categoryCourse.addClass("span-category-course");
                            categoryCourse.innerHTML = " Category " + j; 
                            categoryCourseContainer.append(categoryCourse);
                        }
                        singleCourseContainer.append(categoryCourseContainer);
</script>

CSS:

.web-col-responsive {
    width: 20%;
}

    .course-title {
        font-size: 20px;
        font-weight: bold;
        padding: 5px;
        background-color: #006063;
        border-bottom: 2px solid #006063;
        border-top: 2px solid #006063;
        color: white;
        display: block;
        width: 100%;
    }

    .course-module-description {
        font-size: 13px;
        color: black;
        padding: 5px;
        font-weight: bold;
        margin-bottom: 0px;
        -webkit-transition-duration: 0.4s;
        -moz-transition-duration: 0.4s;    
    }

    .container-geral-courses {
        width: 100%;
        display: inline-flex;
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
    }

    .img-course-thumbnail {
        height: 140px;
        width: 100%;
    }

    .container-category-course {
        width: 100%;
        text-align: left;
    }

    .span-category-course {
        font-size: 11px;
        padding: 4px;
        color: #404040;
        -webkit-transition-duration: 0.4s;
        -moz-transition-duration: 0.4s;
    }

    .container-div-course {
        margin: 10px;
        border: 1px solid #006063;
        border-radius: 3px;
        box-shadow: 4px 4px 6px #8f8f8f;
        padding: 0;
        -webkit-transition-duration: 0.4s;
        -moz-transition-duration: 0.4s;
    }

To enhance readability, here's an image depicting the HTML structure: https://i.sstatic.net/XDmlY.png

Answer №1

To push the categories down using flex, you can apply the margin-top:auto property. Here is the code snippet to achieve this:

.course-container {
 display:flex;
 flex-direction:column;
}
.course-container .category-container {
  margin-top:auto;
}

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

ng-Pattern in AngularJS

Enter a number as your username in the field below: <fieldset class="col-sm-12 col-xs-12 text-center"> <label for="username">Username</label> <input type="text" id="username" ng-pattern="/^[0-9]*$/" ...

Flip-Card: Hrefs malfunctioning within card.flip

Currently, I am incorporating a flip-card building block from the Foundation CSS framework into my portfolio projects. However, I have encountered an issue with the two links placed on the back/inner side of each card - for some reason, the hrefs are not f ...

NextJS 13 causes tailwind to malfunction when route group is utilized

I've encountered an issue in my NextJS 13 application where Tailwind classes are no longer being applied after moving page.tsx/layout.tsx from the root directory to a (main) directory within the root. I suspect that there may be a configuration that i ...

The "Key" function from Object.keys does not yield true when compared to an identical string

Object.keys(data).forEach((key) => { bannerData[key] = data[key][0]; console.log(key); if (key == "timestamp") { labels.push(data[key]); console.log("wtf"); console.log(labels); ...

Are HTML mistakes considered as WCAG violations?

In my quest to ensure that my website is WCAG compliant, I have done a lot of research. However, one question still lingers in my mind: Would a document with HTML errors still be considered WCAG 2.0 AA compliant? I recently ran Total Validator and it pro ...

Differences in rendering with Google Chrome when zooming in or out

After creating some code, I observed a peculiar issue. At 500% zoom, the DOWNLOAD button aligns perfectly with the left wall without any gap. However, upon reducing the zoom to 250%, a green background segment becomes visible. To witness this anomaly, refe ...

The dropdown height feature is experiencing issues in the Chrome browser

3 radio buttons and a single select box are displayed on the page. When clicking on the first radio button, the select box should show contents related to the first radio button. However, when selecting the second or third radio buttons, the select box hei ...

Is there a way to locate the following image tag following a specific DOM tag, regardless of its sibling status?

In the scenario of HTML code like this: <html> <h1>heading</h1> <div> <div> <span> <img src="source"/> </span> </div> </div> </html> The example above is just ...

What is the purpose of the Debug entry in my initial package.json file?

Hey there, world! I'm encountering a debug message and not entirely sure why. I'm new to working with node.js. Any idea why this debug message is appearing? ...

Aligning the Navbar Brand vertically in Bootstrap 4

I am seeking advice on creating a single navbar with a centered brand logo that stays aligned at the top and bottom of the navbar. I want to ensure that as the brand logo grows in size, the navbar does not expand with it. The goal is to align the bottom e ...

Tips for reducing the size of Javascript code upon clicking a button while also implementing validations

I need help with a textEditor feature. I want users to be able to write Javascript functions, and when they click a button, the code should be validated for correct syntax and then minified. This functionality needs to be implemented using either Javascrip ...

Obtaining CSS styles in the code-behind of an ASP.NET application

Is it possible to retrieve CSS styles from a styles.css file in ASP.NET C# code behind, or is a workaround necessary? I haven't been able to find a solution online. While utilizing themes in my web application, I also require server-side processing a ...

Which software is recommended for converting Sass to CSS on a Linux operating system?

Just starting out with Sass and I've run into a snag. Currently following a tutorial that utilizes Scout as the Sass compiler for generating CSS. The issue is that Scout is compatible only with Windows and Mac, while I work on Ubuntu Linux. Any reco ...

Unsure of the process for extracting elements from a dynamically loading webpage with selenium

Currently, I am in the process of scraping reviews and skin types from Sephora. However, I have encountered a challenge with extracting elements from the page. Sephora.com dynamically loads reviews as you scroll down the page, prompting me to switch from B ...

Setting up Bootstrap in Visual Studio for a seamless integration

Currently, I am working with the most recent version of VisualStudio which includes an older version of Bootstrap 3 when selecting the application template. I attempted to manually transfer the library files from the updated Bootstrap 4 to the root folde ...

Discovering the significance of a function's scope

I'm a bit confused about how the answer is coming out to be 15 in this scenario. I do understand that the function scope of doSomething involves calling doSomethingElse, but my calculation isn't leading me to the same result as 15. function doSo ...

Tips for arranging five images side-by-side in a row

I have a collection of 5 images: Image 1: Image 2: Image 3: Image 4: Image 5: The dimensions of each image are as follows: Image 1: 70x40 Image 2: 80x42 Image 3: 90x44 Image 4: 100x46 Image 5: 120x48 I would like to arrange these images ...

Injecting variable styles into my VueJS component

I am currently working on developing a custom progress bar to visualize the percentage of completed tasks. The approach I am taking involves using v-bind:styles and passing {width: dynamicWidth + '%'} to regulate the progression of the bar. To ac ...

When trying to target the checkbox value, the error "Object Expected"

My script successfully changes the value of a checkbox to toggle whether or not the user is in a specific Skype response group: var ie = WSH.CreateObject('InternetExplorer.Application'); url = "https://lyncfeg.DOMAIN.COM/RgsClients/Tab.a ...

Learn how to conditionally disable an input element in Angular using simple steps!

My task involves creating a grid of input elements by using a numeric array named board. I need to selectively disable specific elements based on their values. Whenever board[i][j] contains a non-zero value, the corresponding input element should start off ...