What steps do I need to take to transform this square-within-a-square design into a horizontal

I'm having some trouble representing this layout horizontally. I need to figure out what changes are needed for it to work properly. My goal is to have the small squares at the bottom stacked vertically on top of each other, while keeping the bigger square's design intact.

.date-grid {
    width: 120px;
    height: 100px;
    display: flex;
    flex-direction: column;
}

.node {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    border: none;
    padding: 0;
}

time {
    display: block;
    height: 75%;
    font-size: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
  
.smallHolder {
    width: 100%;
    height: 25%;
    display: flex;
}
  
.smallHolder>div {
    width: 25%;
    height: 100%;
    flex-shrink: 0;
    flex-grow: 1;
}
  
.next { background: #0060df; }  

.last { background: #d53343; } 
<div class="date-grid">
    <button class="node">
        <time>3</time>
        <div class="smallHolder">
            <div class="next"></div>
            <div class="last"></div>
        </div>   
    </button>
</div>

Answer №1

Are you searching for something like this? Grid can be very helpful in situations like these.

.date-grid {
  height: 100px;
  display: grid;
  grid-template-columns: 120px 25px;
  grid-template-rows: 1fr 1fr;
  grid-template-areas: "gray next" "gray last";
  padding: 0;
  border-style: none;
}

.gray {
  grid-area: gray;
  display: grid;
  place-content: center;
  background: #e9ecef;
}

time {
  font-size: 24px;
}

.next {
  grid-area: next;
  background: #0060df;
}

.last {
  grid-area: last;
  background: #d53343;
}
<button class="node date-grid">
  <time class='gray'>3</time>
  <div class="next"></div>
  <div class="last"></div>
</button>

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

Slider displays images generated by PHP in a horizontal motion

Currently, I am in the process of creating a custom horizontal slider for my client's personalized gallery. The gallery comprises elements displayed as a no-wrap, multi-window-width block, designed to change its margin-left when the slider arrows are ...

Stop hyperlinks from wrapping on the navigation bar in Bootstrap 4

Is there a way to prevent the links in the navbar from breaking lines when zooming in? I want them to remain on the same line until the navbar collapses. In the example below (click to view full size), there are 6 links. When you zoom in, at a certain poi ...

Is there a way to retrieve information from all pages of a table on a webpage using Chrome?

On a webpage, I have a table containing 100 rows that are displayed 20 at a time. By clicking "next page," I can view the following set of 20 rows and the table view is updated accordingly. I am able to access the data for each batch of 20 rows using dev ...

Creating a straightforward CSS design that stretches to fit the entire viewport dimension

I am attempting to create a simplistic layout using HTML/CSS, as depicted in the wireframe below: /------------------------------------------\ | | | header div | | ...

Utilizing Django template tags in a web link

In the content of my .html file, I have this particular snippet: <ul> {% for file in files %} <li><a href="{% static 'notebooks/<**Part that needs to be dynamically referenced**>' %}">{{ file }}</a></ ...

expandable div or cell panels

Greetings, I'm facing a challenge with my code: <div id="left"></div> <div id="center"></div> <div id="right"></div> My goal is to ensure that #center always displays at a minimum size, while the other two divs w ...

Angular - applying the number pipe only when a value is present

While developing my shop app, I encountered an issue with the number pipe. Is there a way to format numbers like 64.90 to display two digits after the decimal point only if there is a value in the database, such as 64.9, and if it's 60 in the database ...

Collapsing margins within table elements

There are multiple tables on a single page that need to be separated by some space. However, some of the tables have empty cells, resulting in zero height, and I do not want any extra spacing between them. Although margin collapsing is typically an effect ...

adjust the dimensions of the clickable icon's background

Is there a way to expand the pressable area of a close icon without altering its size? For example, if the icon is 19X19 pixels, can the pressable area be increased to 39X39 pixels? The concern lies with the div element containing the close button and the ...

What is the CSS method for styling a color label on an active input box?

I am trying to achieve a specific effect where the label changes color when the input box is in focus. However, my current CSS code does not seem to be working as expected. Can someone please explain why and provide a solution to fix this issue? .test-l ...

Display outcome generated by JavaScript in the input box

I've successfully implemented a date/time picker in a form. Using JavaScript, I've created a script to calculate the difference between two date fields and display it in a third field labeled Course Duration. However, I'm encountering an i ...

Display an icon to act as a separator between icons in CSS styling

Is there a way to display a spacer line before and after icons (cross symbols) while excluding the spacer line before and after buttons carrying the word "Cancel"? How can this be achieved? This is my CSS file: .Container > *:first-child::before, .Con ...

A single column in Bootstrap displaying text vertically

Looking to rotate the "VERTICAL_TEXT" (third bootstrap column) by 90 degrees, I attempted the code below: <div class="row"> <div class="col-xs-2" style="background-color: yellow;"> <span>FOO1</span><br/> & ...

Step by step guide on inserting View and Delete buttons in an HTML table populated by JSON data

I've successfully loaded data from a JavaScript file in JSON format into a plain HTML table using JavaScript. Everything is working well so far. I now want to enhance the table by adding two buttons, View and Delete, that when clicked will redirect to ...

Troubleshooting directive not functioning properly with AngularJS ng-click

My HTML img tag is not responding to ng-click when clicked. I'm puzzled by this issue occurring in masonryPictureView.html Main page - home.html <ng-masonry> <ng-picture ng-items="projectdescription.pictures"></ng-picture> </n ...

When double quotes are used in a string within an HTML input field, they may display as &

Using PHP, I am retrieving data from an SQL database and generating JavaScript code to create an edit button for each entry. The edit button triggers a text input field within a form. When the user clicks on the generated edit button, the text in this inpu ...

What is the best way to remove bootstrap when transitioning to a new microfrontend?

Our team is facing an issue with styling when using a combination of React, Bootstrap, and Tailwind. The problem arises when linking our micro frontend to modules that use Tailwind, as the Bootstrap styles persist despite the change. Since both Tailwind an ...

Div blur event for editing content

Utilizing a content editable div as an input control has presented some challenges for me. Unlike a textarea or input element, the div does not send information to the server automatically. To work around this issue, I have implemented a solution where I u ...

When employing DIV instead of TABLE, the issue arises where the width of the DIV does not completely occupy

<div style="width:100%;"> <div style="background-image:url('../images/navi/top-red.png'); float:left;"></div> <div style="width:180px; float:left"><img src="/images/navi/logo.jpg" ...

Define the hover color options within your personalized Bootstrap 4 design

Currently, I have customized Bootstrap 4.5.3 with some simple modifications. Below is the custom SCSS code I am using: $newcolor1: #00a89c; $newcolor2: #e61b53; $colors: ( "newcolor1": $newcolor1, "newcolor2": $newcolor2 ); $ ...