How can I make a row div taller?

Looking at the livelink and code provided below, I have successfully created a responsive grid layout. The last adjustment that needs to be made is to change some of the squares from square shape to rectangular.

The top two squares in the second column and the last two squares in the bottom row need to be transformed into rectangles. While I have managed to create a horizontal rectangle, I am struggling with maintaining the integrity of the row when adjusting the height of the squares vertically.

If anyone could guide me through a simple way to achieve this, I would greatly appreciate it as my previous attempts have not yielded the desired outcome.

Thank you

CSS

.trigger{
    width:200px; 
    height:200px; 
    margin-right:15px;
    margin-bottom:15px; 
}
.hover-img, 
.hover-img.hover_effect  {
    background-color:white;
    position: relative;
    width: 200px;
    height: 200px;
    -webkit-transition: all 1s ease-in-out;
    -moz-transition: all 1s ease-in-out;
    -ms-transition: all 1s ease-in-out;
    -o-transition: all 1s ease-in-out;
    transition: all 1s ease-in-out;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    -webkit-transform-style: preserve-3d;
    text-align: center;
    font-size: 0;
    -webkit-user-select: none;
    -webkit-touch-callout: none; 
    border-style: solid;
    border-width: 1px;
    border-color: #4595ff;
}
.trigger:hover > .hover-img {
     -webkit-transform:rotateY(360deg);
    -moz-transform:rotateY(360deg);
    -ms-transform:rotateY(360deg);
    -o-transform:rotateY(360deg);
    transform:rotateY(360deg);
    font-size:14px;
    color:white;
}

.img1 {
    background-size: 100% 100%;
    background-repeat: no-repeat; 
}
.img1:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.img2 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img2:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.img3 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
} 
.img3:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img4 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img4:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img5 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img5:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img6 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
.img6:hover{
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

#container{
    width:960px; margin: 0 auto;
}

.row{
    display: flex;
}

HTML

<div id="container">
    <div class="row">
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img1"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img2"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img3"></div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img4"> </div>
        </div>
    </div>
    <div  class="row">
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img5"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img6"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img5"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img6"> </div>
        </div>
    </div>

    <div  class="row">
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img5"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img6"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img5"> </div>
        </div>
        <div class="trigger">
            <div tabindex="0" class="maincontent hover-img img6"> </div>
        </div>
    </div>

</div>

Answer №1

Interested in finding something similar to this? Check out the DEMO

CSS:

.trigger.vertical {
    height: 415px;
    background-color:#ccc;
}
.trigger.vertical * {
    height: 415px;
}

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 about trying out the magic of Bootstrap columns?

My issue pertains to bootstrap columns. Whenever I zoom in on the browser, the columns start overlapping and the text from col-md-7 ends up over the image. Does anyone know of a solution to this problem? <div class="row"> <div class="col-md-5 ...

Buttons in Laravel are shifting unexpectedly

There are three buttons available with different functions. <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('update') ...

What could be causing my tab code to not function flawlessly?

I am attempting to implement a tab concept on my website. For example, the tab names are Monday...Tue.. up to Sunday. Each tab contains an image file based on the days (size 460*620). When I run my page, it shows all images, but what I need is for the imag ...

How to update an array in Angular using ngModel and ngFor

I am attempting to display an array's values on a form and then allow for updating those same values in the array (using name="todos{{i}}" within the <input> tag does not work as it turns it into a string instead of an array). The curr ...

tainted ajax outcome

Check out this HTML page I am using: <html> <head> <title>AJAX Example</title> <meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1"> </head> <script language="JavaScript" src="ajaxlib.js"> ...

Tips for updating the background color of a specific row

I have a piece of code that I am trying to modify with a specific condition. If {row.BB} is less than or equal to 100, I want to change the background color of the row with this value to red. Can someone help me achieve this? The code is linked to a data ...

After closing and reopening the jQuery modal, the name does not appear

I crafted a custom modal window to display images along with comments and the owner's name. The issue arises when I close the current modal and reopen it; the owner's name disappears. Oddly enough, the name is displayed the first time the modal i ...

Parsing HTML files with Perl to extract XML data

Can an XML output be generated from a webpage using web::scraper in Perl? Here is an example of HTML taken from a URL: > <table class="reference"> > <tr> > <th width="23%" align="left">Property</th> > ...

The alignment of Bootstrap 4 cards is not coming together as expected

Good morning, I'm currently working on organizing my Bootstrap card elements into rows of 3 cards each. I want the cards to be uniform in height and width, with spacing between them. For instance, if I have 7 cards, I'd have 3 rows of three card ...

Include parameters for a pagination system

I have a script that fetches data from my database and generates pagination. Everything is working fine, but now I want to include a conditional statement to differentiate the user level as New, Current, or Renewing client. I've already set up some s ...

What is the most efficient way to load a PHP page once the webpage has completely finished loading?

I'm relatively inexperienced when it comes to PHP and JQuery, so please bear with me if my knowledge is limited. Currently, I'm facing an issue where loading a small HTML table that contains information queried from game servers (like shown in t ...

Are there alternative methods to retrieve the CSS properties of web elements more effectively than relying on selenium?

I have a situation in my code where I need to retrieve the CSS properties of a large number of web elements. Currently, I am using Selenium and the code looks like this: ... node = browser.find_element_by_xpath(xpath_to_node) return {k: node.v ...

Rotate object within HTML table

I have a simple data structure as shown below: [ { "ClientId": 512, "ProductId": 7779, "Date": "2019-01-01", "Quantity": 20.5, "Value": 10.5 }, { "ClientId": 512, "ProductId": ...

Non Rectangular Header with Bootstrap's Responsive Navbar

Currently, I'm in the process of developing a website and I've been pondering if it's feasible to design a bootstrap navbar with a uniquely shaped header as a background. I envision the header to resemble something like this: https://i.sst ...

Looking to determine if a specific element is assigned multiple class names

Help needed! Can you tell me how to check if an element contains more than one classname using pure javascript, without using jQuery? For example: If #test has both the classnames "classA and classB", then { alert(true) } else { alert(false) } Here is ...

I am looking to expand the width of the Bootstrap container specifically for the Max width

I need to adjust the width of the Bootstrap container to be responsive on all devices, especially maximizing the width on larger screens. Can anyone provide guidance on how to achieve this? Thank you in advance. To view my website, please follow this link ...

Is there a way to eliminate the blue formatting on my phone?

I've encountered a styling issue on my website when viewing it on mobile, specifically with links on iPhone. I've already attempted the solutions mentioned in this discussion: How do I remove the blue styling of telephone numbers on iPhone/iOS? ...

What makes this CSS causing render blocking?

I've been meticulously following the Google PageSpeed guidelines in order to optimize the performance of my website. Upon running an analysis, Google provides me with a score based on their set guidelines. There's one particular guideline that ...

Resize the shape of an image's polygon

Is there a way to independently scale a specific polygon of an image on hover? For example, I have a world map and I would like to enlarge a country when hovering over it, then return it to its original size when no longer hovering. I am familiar with us ...

Challenges Faced When Implementing Dropdown Navigation Bars

Whenever the screen width is less than 576px, I notice that the menu icon on my website shifts its position along with the title (FOOD, LLC). How can I resolve this issue? Website: ...