×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Achieving this grid layout in css

Achieving this grid layout in css

Achieving this grid layout in css

(OP)
I am trying to achieve this layout, but struggling

https://ibb.co/yWPg8SR

I split in to two columns initially, the left column having two divs one on top of the other. The right having two rows, with divs within them.

Here's my html

<div class='home-grid'>

            <div class='home-grid-left'>

                <div class='home-grid-left-top' style='background: url(images/spacer.png)'><a href=''><span>SALE</span></a></div>
                <div class='home-grid-left-bottom' style='background: url(images/spacer.png)'><a href=''></a></div>

            </div>

            <div class='home-grid-right'>

                <div class='home-grid-right-top'>

                    <div class='home-grid-right-top-left' style='background: url(images/spacer.png)'><a href=''></a></div>
                    <div class='home-grid-right-top-right' style='background: url(images/spacer.png)'><a href=''></a></div>

                </div>

                <div class='home-grid-right-bottom'>

                    <div class='home-grid-right-bottom-left' style='background: url(images/spacer.png)'><a href=''></a></div>
                    <div class='home-grid-right-bottom-right' style='background: url(images/spacer.png)'><a href=''></a></div>

                </div>

            </div>

        </div> 

and here is my css

.home-grid {position: relative; display: flex; height: 450px; margin: 50px 0}
.home-grid div {position: relative;}
.home-grid div a {position: absolute; top: 0; right: 0; bottom: 0; left: 0}
.home-grid-left {position: relative; flex:1; margin-right: 10px; flex-direction: column; background-color: azure}
.home-grid-left-top {margin-bottom: 10px; min-height: 200px}
.home-grid-left-bottom {flex: 2; flex:auto}

.home-grid-right {position: relative; flex: 3; background-color: aliceblue} 

I am stuck on the home-grid-left-bottom as it isn't showing. The spacer.png is just an image placeholder, the final version will have images on each div.

Can anyone help?

Thanks

RE: Achieving this grid layout in css

(OP)
Sorted it, I just needed to take a break and come back afresh. If anyone wants a similar layout

.home-grid {position: relative; display: flex; height: 450px; margin: 50px 0}
.home-grid div {position: relative;}
.home-grid div a {position: absolute; top: 0; right: 0; bottom: 0; left: 0}
.home-grid-left {position: relative; flex:1; display: flex; margin-right: 10px; flex-direction: column; }
.home-grid-left-top {margin-bottom: 10px; min-height: 200px}
.home-grid-left-bottom {flex: 2; flex:auto}

.home-grid-right {position: relative; flex: 3; display: flex; flex-direction: column; }
.home-grid-right-top {flex: 1; display: flex; flex-direction: row; min-height: 260px; margin-bottom: 10px;}
.home-grid-right-top-left {flex: 2; margin-right: 10px;}
.home-grid-right-top-right {flex: 3}
.home-grid-right-bottom {flex: 1; display: flex; flex-direction: row}
.home-grid-right-bottom-left {flex: 3; margin-right: 10px;}
.home-grid-right-bottom-right {flex: 2} 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close