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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:48:11+00:00 2026-05-30T12:48:11+00:00

I have a regular layout that looks that this: This layout is done using

  • 0

I have a regular layout that looks that this:
enter image description here

This layout is done using CSS floats.

When I switch to mobile, I want my layout to do this:

enter image description here

That is, I want my sidebar to be below the content. I can do this using absolute positioning, but I was wondering, is there a way to do this using floats so that if my content changes the sidebar will adjust for the height difference?

  • 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-30T12:48:13+00:00Added an answer on May 30, 2026 at 12:48 pm

    Here’s how I would do it. The DIVs are floated on your desktop version, but displayed on top of eachother (default block display) on mobile.

    CSS:

    #sidebar {
        float: left;
        width: 30%;
    }
    
    #content {
        float: right;
        width: 70%;
    }
    
    .mobile #sidebar,
    .mobile #content {
        float: none;
        display: block;
        margin-bottom: 15px;
    }
    

    Standard HTML:

    <body>
    <div id="content">
    ...
    </div>
    <div id="sidebar">
    ...
    </div>
    </body>
    

    Mobile HTML:

    <body class="mobile">
    <div id="content">
    ...
    </div>
    <div id="sidebar">
    ...
    </div>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Regular Expression that matches the following strings: <!-- 09-02-2009 ---> <!--
I want to convert an existing SVN repository with a nonstandard layout that looks
Just a question about css for mobile devices, i have an image that is
I have this regular expression: ^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$ however it is failing when i have an
I have a regular expression like this (much simplified): ^(ab)*$ And am matching against
I have a layout in Google Web Toolkit using UIBinder involving a TabLayoutPanel .
I'm trying to make a CSS table that (for layout purposes) has a caption
I have some data.. it looks similar to this: 0423 222222 ADH, TEXTEXT 0424
Is it possible to have a regular html page inherit its layout from another
I have the following text layout: Heading Chapter 1:1 This is text 2 This

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.