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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:42:56+00:00 2026-05-15T15:42:56+00:00

I have a page in which a header consists of three divs – one

  • 0

I have a page in which a header consists of three divs – one that’s floated to the left, one that’s floated to the right, and one that’s in between them. I’d like for that central div to be centered, yet sadly float: center doesn’t exist and I can’t just float it to the left and add padding as it’d have to change depending on the window size.

Is there something simple I’m overlooking? Or how would I do such a thing?

Update:
In addition, I’d like to find a way of centering that middle div in the space between the divs in case that looks better.

  • 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-15T15:42:57+00:00Added an answer on May 15, 2026 at 3:42 pm

    If you have two floated divs, then you know the margins. The problem is that the float:right div should be put before the middle div. So basically you will have:

    left-floated | right-floated | centered

    Now, about the margins: usually you can just use margin:0 auto, right? The problem is that right now you know the values of the margins: floated divs! So you just need to use:

    margin:0 right-floated-width 0 left-floated-width

    That should work.

    Years later edit

    Meanwhile, a new toy is in town: flexbox. The support is fairly good (i.e. if you don’t need to support lower than IE 10) and the ease of use is way over floats.

    You can see a very good flexbox guide here. The example you need is right here.

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

Sidebar

Related Questions

I have this page which has three peson searchs on them. Basically it's a
I'making website which is for all desktop/iPad/iPhone. In one page I have header and
If I have A main page which composed from more than one section (header,main,side,etc..),each
I have page which consists of couple fragments and in the header fragment I
I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
I have one Page which is displaying details of some Client. I am using
i have one file for the header which is included on all of my
I had a home page which have a few tables that refresh itself every
I have a multiple html tables on a page which each have a header
A have a problem with PHP application, that I'm working on. Main page which

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.