Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:55:28+00:00 2026-05-25T23:55:28+00:00

I have a site that I’d like to layout like this image: Red is

  • 0

I have a site that I’d like to layout like this image:

Desktop:A B/C D/E F Mobile: A B C D E F

Red is the desktop version and yellow is the mobile version. I can easily switch between the two using media queries.

My problem is how to write the CSS for the desktop version – I only include the mobile version because the layout precludes some layout techniques for the desktop version.

The content within each pair (e.g. A and B) can be of different heights, but they’re similar enough that I’d like to lay them out as equal heights so the next pairs headers line up.

The easiest way I guess is to hardcode the heights for each pair, but I’d rather avoid that if possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:55:29+00:00Added an answer on May 25, 2026 at 11:55 pm

    You should use a container for those elements.

    for example a <ul> and the elements themselves be <li> elements.

    example html

    <ul class="container">
        <li>A</li>
        <li>B</li>
        <li>C</li>
        <li>D</li>
        <li>E</li>
        <li>F</li>
    </ul>
    

    desktop CSS

    ul.container li{
      width:45%;
      margin-right:5%;
      float:left;
    }
    
    ul.container li:nth-child(odd){
      clear:left;
    }
    

    mobile CSS

    ul.container li{
      width:100%;
    }
    

    Demo at http://jsfiddle.net/gaby/AgNjB/1


    notice

    The above code works if you only want to line-up their headers (the left and right tops are at the same place). But it will need alterations if you want their actual height to line up as well (for a bottom border for instance)..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have site that I want to look like this: but instead it looks
I have a site that allows users to vote on images. Each image has
I have a site that utilizes a bottom fixed position masthead here: http://www.entheospartners.com/newsite/ This
I have a site that have URL similar to this: /mysite/admin/controller/action/id /mysite/search/controller/action/id /mysite/user/controller/action/id I
I have a site that host more then 60 services. With the simplified version
I have a site that gets a user data on logging in. this data
I have a site that I'm trying to make a printable version and I'm
I have a site that offers a keyword search. The user can perform a
I have a site that has a CSS layout and shouldn't have a scrollbar
We have a site that we would like our customers to embed in their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.