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

  • Home
  • SEARCH
  • 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 8531417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:28:46+00:00 2026-06-11T09:28:46+00:00

I have a header that contains three inline-blocks. The element containing these blocks is

  • 0

I have a header that contains three inline-blocks. The element containing these blocks is set to text-align center, the left block floats left, and the right black floats right. This results in a nice effect such that the middle block’s text gets centered on screen, (almost) regardless of window size.

If you make the window much smaller, the blocks stack on top of each other…which is what I need. The issue is that, because of the floats, they do not “jump” into position. I.e., as the blocks shift from horizontal to vertical to stack on top of each other, the right-most block sticks to the right side (leaving a big white space to the left). And the middle block, because of text-align: center, doesn’t jump over either. So I’m left with a “stair/stepped” effect on screens that are small, but not small enough to force a full stacking.

Check out this js fiddle to see what I mean: http://jsfiddle.net/fphzY/15/

HTML:

<div id="top">

    <div class="topBox">
        <div id="companyLogo">
            IMG
        </div>
    </div>

    <div class="topMiddleBox">
        <div id="shortcuts" class="headerList">
            List of Links
        </div>
    </div>

    <div class="topRightBox">
        <div id="welcome">
            Links
        </div>
        <div id="globalLinks">
            Links
        </div>
    </div>

</div>

CSS:

#top{
 padding:0;
 text-align:center;
 vertical-align:top;
}

.topBox{
    min-width: 100px;
    min-height: 100px;
    background-color:#ccc;
    vertical-align: top;
    display: inline-block;
    *display: inline;
    zoom: 1;
    float: left;
}

#companyLogo {
    margin: 15px 0px 10px 20px;
    vertical-align: top;
    background-color:#000;
    color:#fff;
}

.topMiddleBox{
    min-width: 100px;
    min-height: 100px;
    vertical-align: top;
    display: inline-block;
    *display: inline;
    zoom: 1;
    background-color:#66CCFF;
}
#shortcuts{
    display: inline;
    background-color:#000;
    color:#fff;
}

.topRightBox {
    min-width: 100px;
    vertical-align: top;
    display: inline-block;
    *display: inline;
    zoom: 1;
    float: right;
    margin-top: 27px;
    background-color:#FF8000;
}

#welcome 
{
    font-weight: normal;
    margin: 23px 20px 0px 0px;
    text-align:right;
    color: #424242;
    font-size: 10pt;
    background-color:#000000;
    color:#ffffff;
}

#globalLinks
{
    margin: 7px 20px 0px 0px;
    vertical-align: middle;
    text-align: center;
    padding:5px 2px 0px;
    background-color:#FFFF66;
    color:#000000;    
}

#globalLinks ul 
{
    list-style: none;
    padding: 0;
    margin-top: -5px;
    margin-left: 0;
}
#globalLinks ul li
{
    padding: 0;
    margin-left: 3px;
    display:inline;
}
#globalLinks ul li span
{
    padding-right: 2px;
}

Now, I know this is expected behavior, but I’m trying to find a way to achieve my goals (three horizontal containers–one stuck to the left side, one stuck to the right, and one centered–that stack nicely on top of each other as the window shrinks) using just CSS. Is this possible?

  • 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-11T09:28:47+00:00Added an answer on June 11, 2026 at 9:28 am

    Not sure if this is want you want, but I was thinking you could make each of the three divs one third of the width, like this:

    http://jsfiddle.net/henrikandersson/vFkv9/1/

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

Sidebar

Related Questions

I have a FlowDocument that contains lists with a header: Header 1 - Item
I have a header on my webpage that contains the some javascript for some
I have a String that contains an HTTP header. I want to turn this
I have a global presenter that contains a Header Footer and the main content
I have a header file that contains a class. Within that class, I have
Let's say I have a tab-delimited text file that contains data arranged in columns
I have a web document that contains a div element. That div element contains
I have a struct defined in a header file with three other files that
I have a partial that contains a header, a subheader and potentially one or
I'm interested in the way lala.com works. They have a header that remains fixed

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.