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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:03:34+00:00 2026-06-14T11:03:34+00:00

I am trying to learn responsive design. I am building a website and one

  • 0

I am trying to learn responsive design. I am building a website and one of the pages is a portfolio. I set up the following mockup of how I would lay out this page. it is a very stripped down version of course. I cannot seem to apply the proper queries so that this format would look ok on a widescreen desktop, an ipad and lets say a mobile phone. I started the 1st query but it isnt working of course and also know if that is the best size for a common widescreen desktop.

Can anybody get me started on how to apply that to this page? Im going to continue on tutorials but need a kick start here.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<style type="text/css">
@media screen and (max-width:1080px) {
    #main {
        width: 960px;
    }
}
body {
    background-color: #FFF;
    margin:0;
}

#main {
    width: 1080px;
    margin-right: auto;
    margin-left: auto;
    height: 860px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.box {
    background-color: #CCC;
    height: 200px;
    width: 200px;
    margin-right: 20px;
    float: left;
    margin-bottom: 20px;
}
.box_last {
    background-color: #CCC;
    height: 200px;
    width: 200px;
    float: left;
    margin-bottom:20px;
}
.box_bottom {
    background-color: #CCC;
    height: 200px;
    width: 200px;
    margin-right: 20px;
    float: left;

}
.box_last_bottom {
        background-color: #CCC;
    height: 200px;
    width: 200px;
    float: left;

}
</style>
</head>

<body>
<div id="main">
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box_last"></div>

  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box_last"></div>

  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box_last"></div>

  <div class="box_bottom"></div>
  <div class="box_bottom"></div>
  <div class="box_bottom"></div>
  <div class="box_bottom"></div>
  <div class="box_last_bottom"></div>
</div>
</body>
</html>
  • 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-14T11:03:35+00:00Added an answer on June 14, 2026 at 11:03 am

    In your current code the #main from the media query block is getting overwritten. You have to put your media queries at the very bottom of your CSS

    #main {
        width: 1080px;
        ...
    }
    
    @media screen and (max-width:1080px) {
        #main {
            width: 960px;
        }
    
        .box {
            width: 200px;
            ...
        }
    }
    

    And then for a smaller screen

    @media screen and (max-width: 480px) {
        #main {
            width: 100%;
        }
    
        .box {
            width: 50%;
            ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to learn Sencha Touch 2 and I can't seem to find out how
Trying to learn about php's arrays today. I have a set of arrays like
I am trying to learn XSLT and having some issues. I would think that
I am trying to learn ASP. I set up IIS on my Windows 7
I'm trying to create responsive design webpage. it works well with my table and
I am trying to learn unit tests. Following is my first ever written unit
I'm trying to learn Servlets/JSP. When I tried the following code I dont get
I've been trying to learn Backbone. I set up collection of models, each of
I'm trying learn more about RavenDB and at the moment to focus on how
I am trying learn the use of lambda expressions and hence still struggling to

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.