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 8515579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:11:13+00:00 2026-06-11T05:11:13+00:00

So far I have this JsFiddle – an arrangement of DIVs that using media

  • 0

So far I have this JsFiddle – an arrangement of DIVs that using media queries changes as the width of the area reduces and maintains a layout that fits to 100% of the container width.

The problem I am having is trying to separate the DIV because the layout is percentage based.

My efforts to include a margin have so far failed to work in keeping everything perfectly formatted.

Any help here would be much appreciated.

Here is the CSS…

#photos {
   /* Prevent vertical gaps */
   line-height: 0;
   width: 100%;
}
#photos img {
  /* Just in case there are inline attributes */
  width: 20%;
  height: auto;
  float:left;
  overflow:hidden;
}

@media (max-width: 1200px) {
    #photos img {
    /* Just in case there are inline attributes */
    width: 20%;
    }
}

@media (max-width: 800px) {
    #photos img {
    /* Just in case there are inline attributes */
    width: 25%;
    }
}
@media (max-width: 400px) {
    #photos img {
    /* Just in case there are inline attributes */
    width: 50%;
    }
}
@media (max-width: 300px) {
    #photos img {
    /* Just in case there are inline attributes */
    width: 100%;
    }
}
  • 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-11T05:11:15+00:00Added an answer on June 11, 2026 at 5:11 am

    if you know how many images you want to see in a row you can use percentuage for margins as well.

    For example. 5 images in a row:

    img { width: 15% ; margin: 0 10% 10% 0;}
    
    img:nth-child(5n+5) { margin: 0 0 10% 0; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this so far: http://jsfiddle.net/26eVE/4/ I want that when the user clicks on
I have this so far: http://jsfiddle.net/u5vhS/54/ . What I want to be able to
I have been trying to get this jsfiddle to work. So far without luck.
I'm using the javascript module pattern, and have this so far: var APP; if(APP
So I have this so far: JSFIDDLE And I for the life of me
http://jsfiddle.net/JkhkJ/ This jsfiddle is what i have so far. I want the select (drop
so far I have this jsfiddle <p>Click the button to remove http:// and www.
So far i have this: mov ah,02h mov cl,11001100001111011101000b ;6,692,584 in dec mov dl,0
Thanks to everyone out there helping newbies like me. So far I have this:
I have this so far but the Column 'name' is ambiguous, so I want

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.