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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:01:27+00:00 2026-05-20T04:01:27+00:00

I have three divs that I would like to display on the same line.

  • 0

I have three divs that I would like to display on the same line. Each of the three has different widths and heights, and they are not straight text. I’d like to left-align one (all the way to the left), right-align another (all the way to the right), and center the third (in the middle of the containing div, the whole page in this case).

In addition, I’d like the three divs to be vertically aligned to the bottom of the containing div. The solution I have vertically aligns them to the top of the containing div.

What is the best way to handle this?

  • 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-20T04:01:28+00:00Added an answer on May 20, 2026 at 4:01 am

    By setting your container div to position:relative and the child divs to position:absolute you can absolute position the divs within the confines of the container.

    This makes it easy, as you can use bottom:0px to align all vertically to the bottom of the container, and then use left/right styling to position along the horizontal axis.

    I set up a working jsFiddle: http://jsfiddle.net/Damien_at_SF/KM7sQ/5/ and the code follows:

    HTML:

    <div id="container">
        <div id="left">left</div>
        <div id="center">center</div>
        <div id="right">right</div>    
    </div>
    

    CSS:

    #container {
        position:relative;
        height:400px;
        width:100%;
        border:thick solid black;
    }
    #container div {
        background:grey;
        width:200px;
    }
    #left {
        position:absolute;
        left:0px;
        bottom:0px;
    }
    #center {
        position:absolute;
        left:50%;
        margin-left:-100px;
        bottom:0px;
    }
    #right {
        position:absolute;
        right:0px;
        bottom:0px;
    }
    

    Note: For the “center” div, the margin-left = 1/2 the width of the div 🙂

    Hope that helps 🙂

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

Sidebar

Related Questions

I have three DIVs, something like this: <div id=header> ... </div> <div id=content> <div
I have divs that I want to display at specific times throughout the day.
I have a list of items with some details that I would like to
I have a variable number of divs acting as columns, and I would like
I would like to make a custom button, that will display 3 data bound
The Setup: I have a page written in JS that has 3 main divs:
I have three divs : <div id=login /> <div id=content /> <div id=menu />
I have three divs: A, B and C. A is currently visible and I
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three unordered lists that have been created as Scriptaculous Sortables so that

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.