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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:36:45+00:00 2026-06-17T07:36:45+00:00

I have a page that has 10 divs acting as big buttons that are

  • 0

I have a page that has 10 divs acting as big buttons that are displaying in 2 rows of 5 but I would like it so that if the page is resized or it is opened on a device with a smaller screen the layout of the buttons changes automatically but I’m not sure how to go about this.

Where should I start looking or does anyone know any good tutorials that could help me achieve this?

Thanks

  • 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-17T07:36:46+00:00Added an answer on June 17, 2026 at 7:36 am

    The name for that is Reactive (or Responsive) Design. You can find a decent intro to it here: http://netuncovered.com/2011/05/reactive-web-design/

    It all comes down to @media queries in the CSS to determine the size of the window you’re dealing with, and changing styles accordingly. Something like:

    @media screen and (min-width:768px)
    {
        .my_div { width: 200px; }
    }
    @media screen and (min-width:1024px)
    {
        .my_div { width: 300px; }
    }
    

    This example gives you different sizes for the divs based on the window size. You can do the same w/ positioning or any other CSS rule based on the size of the screen using @media queries.

    For the specific question of how do you change the number of items in a row, let’s say you have the following HTML:

    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="clear3"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="clear5"></div>
    <div class="item"></div>
    <div class="clear3"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="clear3"></div>
    <div class="item"></div>
    

    You can specify, depending on the size of the viewport, when the class .clear3 or .clear5 will actually clear floats. Something like:

    .item { float: left; width: 200px; }
    @media screen and (min-width:768px)
    {
        .clear3 { clear: both; }
        .clear5 { clear: none; }
    }
    @media screen and (min-width:1024px)
    {
        .clear3 { clear: none; }
        .clear5 { clear: both; }
    }
    

    That will change the number of divs per row of .item divs you have, based on the size of the screen. I think. I didn’t really test it.

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

Sidebar

Related Questions

I have a web page which has many divs (listed like table rows), and
I have a page that has 3 variables. They look like this: String[] Headers
I have a page that has three divs one at the top, one at
I have a page that is rendered that has multiple divs, all at different
I have a page that has some divs. I show images on these divs.
I have a page that has about 20 divs one under the other on
I have a page I am working with that has several hidden DIVs that
I have an html page that has many elements (tables, divs e.t.c) I get
Okay, I have a page on a Drupal install that has multiple divs. I
The Setup: I have a page written in JS that has 3 main divs:

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.