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

  • SEARCH
  • Home
  • 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 8343375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:02:34+00:00 2026-06-09T06:02:34+00:00

This is going to be difficult to explain but hopefully there will be a

  • 0

This is going to be difficult to explain but hopefully there will be a CSS ninja or two who can help me out.

Basically, I want to create a grid of square DIVs (imagine the Windows 7 phone metro interface), which stretches to fit the screen using percentages and has equal gaps horizontally and vertically between the squares.

It sounds quite easy but I really can’t work it out.

Let me give an example. If the screen is 1000px wide and has 5 squares horizontally then I could make each one about 18% wide (180px each, total 90%), leaving 10% for the gaps between them but…

1) How to float each DIV so that there is no gap on the left or right of the screen but 2.5% gap horizontally between each square?

2) How to create a proportional vertical gap to match the horizontal gap between squares as the screen is resized?

3) How to ensure that each DIV remains a square, so the height is exactly proportional the the width which is a percentage of the width of it’s container.

Am I thinking about this all wrong? Very confused.

Any help would really be appreciated.

  • 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-06-09T06:02:35+00:00Added an answer on June 9, 2026 at 6:02 am

    The answer I found in the end was to use a transparent square image. If you make it x pixels wide then it will automatically be resized by the browser to make it x pixels tall. Obviously it’s containing div will also scale accordingly 🙂

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

Sidebar

Related Questions

This will be a bit difficult to explain but I will try my best.
So this is going to be a bit difficult to explain, but I'll give
This is going to be a bit difficult to explain. I'm usually fine with
This is going to be difficult for me to explain, so I'll do my
This is going to be a stupid question but I have spent an inordinate
This is going to be a quick discussion, but I just wanted some feedback
I'm guessing this is going to involve regexp or something, but I'll give it
Initially I thought this was going to work, but now I understand it won't
I think this is going to be one of those simple-when-you-see-it problems, but it
This is kind of difficult to explain so ill link to a page that

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.