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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:43:27+00:00 2026-06-15T08:43:27+00:00

How can I get two div s aligned in the same row on a

  • 0

How can I get two divs aligned in the same “row” on a website?

I have been working on this page, and I have tried to get a menu that floats to the left side of the website and then the content to the side of that.

I have tried using this as the div‘s CSS:

.menu
{
    width:25%;
    height:auto;
    margin-bottom:2px;
    float:right;
    position:fixed;

}
.content
{
    width:70%;
    height:50%;
    margin-bottom:2px;
    padding: 25px;
    float:right;
}

The page is not displaying them side-by-side and floating, but instead how most website such as: http://www.exorithm.com/, where they have a sidebar and an area for content.
Can anyone help?

All my code: http://pastebin.com/KqYkrweE

  • 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-15T08:43:28+00:00Added an answer on June 15, 2026 at 8:43 am

    I think the problem is that you have position:fixed on the menu. If you use position fixed or absolute, it removes the element from the document flow, so float:right becomes irrelevant.

    Edit: Here is a better example of achieving the same result

    Also bear in mind that you are using percentages for width and then applying a pixel based padding. This could lead to the elements becoming too wide for the page and displaying one below the other.

    70% + 25% = 95% with 5% left over.
    

    If the 5% is less than 50px (making the whole width 1000px) then your columns will total greater than the entire width. A better approach would either be to use percentage based padding (not 100% sure how well this works) or to apply your padding, margins and borders to elements inside the floated columns, like so:

    // CSS
    .leftCol {
        float:left;
        width:25%;
    }
    
    .rightCol {
        float:left;
        width:75%;
    }
    
    .content {
        padding:25px;
    }
    
    // Markup
    <div class="leftCol">
        <div class="menu">
            Here is my menu
        </div>
    </div>
    <div class="rightCol">
        <div class="content">
            Here is my content
        </div>
    </div>
    

    Edit 2:
    If you want your menu to stay on screen as the user scrolls down, then position:fixed will do the job. I looked at your page and it looks like you have a fixed width navigation of 206px. Therefore your styles for the existing markup would be better off as something like:

    // CSS
    .menu {
        position:fixed;
        left:0;
        top:0;
        width:206px;
    }
    
    .content {
        padding: 25px 25px 25px 231px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two csv file ( ) I can get it to print out
How I can get name of parent activity in child activity. I have two
I have two questions. How can I get the spinner in the figure below
I have this: <div class=one> <h2>Title that can be quite long and I don't
I have this simple code to place two div #container elements side by side.
I have two divs, one inner and one outer, but the inner div is
I have multiple div's on my page, that can be added to the page
I can get the following simple scenario to work: A div on the page
I have two div's which looks like this <div id=outer> <div id=inner> </div> </div>
I can't get two different svg images to load on my page using Keith

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.