Attempting to organize information within a Materialize Card

First and foremost, a huge thank you to everyone who has been so helpful to many people!
Secondly, I apologize for posting images in Spanish, as I currently do not have the time to translate them into English. Nevertheless, the text within the photos is not essential.

At this time, I am working on developing an interactive degree program. Here is a snapshot of the current state:

https://i.sstatic.net/OAK0F.jpg

My goal is to achieve the following with the cards:

  • Maintain uniform size for all cards
  • Ensure all content (top, middle, and bottom) remains within the cards
  • Adjust the middle content (course names in Spanish) to resize accordingly in order to preserve the card size

For instance, if I apply a 150% zoom, everything will appear as follows:

https://i.sstatic.net/MgjEI.jpg

And when I use a 50% zoom, it aligns closely with what I am aiming for:

https://i.sstatic.net/fiboF.jpg

I have included code snippets where you can see an example of two courses in one year.

.row {
  margin-bottom: 0px !important;
}

#yearHolder {
  margin-left: 5px;
}

.col .s12 {
  padding-left: 0px !important;
  padding-right: 0px !important;
}



.card-content {
  padding-left: 10px !important;
  padding-right: 10px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.card.small {
  height: 150px !important;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">

    <title>Document</title>
</head>
<body>
    <div id="malla" class="row">
        <div id="1year" class="col l2 s6 offset-l1"><h6 class="center">First Year</h6>
            <div id="yearHolder" class="row">
                <div id="1semester" class="col s6">
                    <div class="col s12">
                        <div class="card horizontal red">
                            <div class="card-stacked ">
                                <div class="card-tabs">
                                    <div class="col left">CBM-1000</div>
                                    <div class="col right">8</div>
                                </div>
                                <div class="card-content">
                                    <h6 class="black-text text-flow center-align">Algebra y Geometría</h6>
                                </div>
                                <div class="card-tabs ">
                                    <div class="row">
                                        <div class="col left">1</div>
                                        <div class="col right">12,13,15</div>  
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="2semester" class="col s6">
                    <div class="col s12">
                        <div class="card horizontal red">
                            <div class="card-stacked ">
                                <div class="card-tabs">
                                    <div class="col left">CBM-1010</div>
                                    <div class="col right">8</div>
                                </div>
                                <div class="card-content">
                                    <h6 class="black-text text-flow center-align">Comunicación Elemental para la Ingenieria</h6>
                                </div>
                                <div class="card-tab">
                                    <div class="row">
                                        <div class="col left">1</div>
                                        <div class="col right">12,13,15</div>  
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Please guide me if my request is not formatted properly for quick troubleshooting assistance

Once again, a big thank you to everyone!

Answer №1

It is important to keep Materialize widths unchanged to avoid unforeseen issues. Overriding their grid system using the !important feature can lead to unintended consequences. Instead, consider creating a new class name for specific divs to customize them without affecting the entire website layout.

To ensure consistent sizes, add a class named sameSizeCards to all divs and apply the following CSS:

.sameSizeCards{

       Height: ______;

       Width: 100%; (allow Materialize to determine the width)

}

For text sizing, utilize @media queries to adjust font sizes based on different screen widths.

Answer №2

Materialize offers a range of utility classes (small, medium, and large) specifically for setting the height of cards at 300px, 400px, and 500px respectively:

<div class="card small">
<!-- This card will be 300px in height -->
</div>

https://codepen.io/doughballs/pen/JjRVOgz

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

In your web projects, how many external conditional stylesheets do you typically incorporate specifically for Internet Explorer?

What is the number of external IE Conditional Style-sheets utilized in your web projects specifically for Internet Explorer? Make sure to review this page before you provide an answer: http://css-tricks.com/how-to-create-an-ie-only-stylesheet/ ...

Ways to align text on the left within a centered format

It seems like there is something missing here. I am struggling to align text to the left in a centered div. Below is an example of my final work: <div class="grid-row"> <img src="http://www.fununlimitedsports.com/wp-content/images/istock ...

Step-by-step guide on concealing elements and subsequently displaying them upon clicking the containing DIV

It's a bit tricky to explain without visuals, so I suggest checking out the JSFiddle link provided. Essentially, when a specific div is clicked, it should expand to reveal some inputs and buttons. However, the issue I'm facing is that upon loadin ...

Navigating events within the Material Design Light (MDL) mdl-menu component can be

I am utilizing Material Design Light with just PHP, jQuery, and MDL min CSS and JS, no other frameworks involved. Keeping it simple with a basic menu. <button id="lang-switcher" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect"> ...

Tips for making a div with a single triangular side using Reactjs

Hey there, I'm looking to design a header similar to the one shown in this image. Can someone provide guidance on how I can achieve this UI using React.js? https://i.sstatic.net/zmW5x.jpg ...

Modifying the CSS class of an element does not produce the desired effect after altering its styles using JavaScript

html: <input id="myinput" class="cinput" type="image" src="http://www.foodwater.org.au/images/triple-spiral-3-small-button.jpg"/> <br><br><br><br> <button id="s">set to visible class</button> <button id="h"> ...

Footer Design with Images in Bootstrap

Hi, I recently started using Bootstrap and I'm trying to add a fixed footer to my page with a logo that is taller than the footer itself. I want the footer and the image to be fixed at the bottom of the page, while the image extends beyond the footer. ...

The CSS file seems to be ineffective when building Vue in production

In my Vue project, I am using a single file component with a chart module. In order to customize the styles of the chart module's CSS, I created a custom CSS file in the assets folder where I added lines to override certain styles (such as changing th ...

TabContainer - streamline your selection process with inline tabs

I am currently working on a GUI that includes a TabContainer with two tabs, each containing a different datagrid. I initially created the tabcontainer divs and datagrids declaratively in HTML for simplicity, but I am open to changing this approach if it wo ...

Managing the display of my website's screenshots within the list of recently visited sites on the browser's new tab page

Internet browsers like Firefox and Chrome have the ability to take screenshots of visited websites and display them as "recently used websites" on a new tab. However, if your website contains confidential information, you may be wondering how to prevent b ...

PHP unable to retrieve ID from URL

Is there a way to extract an id from the URL when clicking a button for the purpose of deleting an item from a session? I have tried using $_GET but it doesn't seem to work. <form action="Shop.php?id= <?php echo $values["ProductCode"]; ?>" m ...

Iphone not picking up media queries, while browser resize is working perfectly

Hey there, I'm currently using a theme called Bones on my WordPress site, but I'm encountering some difficulties with the responsive menu on my iPhone. Oddly enough, when I manually resize the window, the menu seems to work just fine. Here' ...

Position the center of an Angular Material icon in the center

Seeking help to perfectly center an Angular Material icon inside a rectangular shape. Take a look at the image provided for reference. https://i.sstatic.net/oFf7Q.png The current positioning appears centered, but upon closer inspection, it seems slightly ...

Setting table row styles for odd and even rows, based on user clicks of an <input type="file"> button

I'm currently working on a feature that allows users to upload files to a page using an button. Each file is displayed in a table as a new row. I am looking for a way to set the background color differently for odd and even rows. As of now, I am usin ...

Fluid imitation pillars with a decorative outer edge

Looking to create a modern, sleek 2-column HTML5 interface with a left sidebar and main content area on the right. Backwards compatibility is not an issue as all users will be using the latest versions of Chrome or FF. The goal is to give the sidebar a ba ...

Sets a minimum width for a Bootstrap panel

I have a panel panel-default on my page to display some data. I want the panel's min-width to be 720px, and if the window is resized to less than 720px, I want a horizontal scrollbar to appear. However, the panel cannot shrink below 720px similar to u ...

What could be causing the drop-down menu to function properly when offline but not when accessed on the server?

When visiting the website here and clicking on the contact link, you should see a Google map. However, for some unknown reason, it does not display. The strange part is that when I open the contact.html file directly, the map works perfectly fine. It seem ...

Guide on how to align multiple divs at the center of a container using CSS

Experimenting with centering a divider in the style of Windows metro. .container { height: 300px; width: 70%; background: #EEE; margin: 10px auto; position: relative; } .block { background: green; height: 100px; width: 10 ...

Achieve vertical center alignment for a flexible top navigation that adapts to different screen sizes

To vertically center the text in my top navigation, I attempted to set a height of 3em for my .header and use vertical-align: middle;. However, this caused an issue with my responsive fold-out menu as it could not handle the fixed height, resulting in the ...

"Embedding Bootstrap, jQuery, and Twitter Bootstrap directly onto

I'm currently working on customizing some source code to fit my needs. To do this, I need to download and use Bootstrap, jQuery, and Bootstrap locally. I have already downloaded all of them to a directory named "libs". However, when I try to run the P ...