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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:06:11+00:00 2026-06-15T17:06:11+00:00

I want to create 3 horizontal bars that will sit at the top of

  • 0

I want to create 3 horizontal bars that will sit at the top of a page.

What I’m trying to achieve is to get the bars to sit from the edge of the screen to about 75% of the width of the page.

The top bar is aligned right, the middle bar aligned left and the bottom bar aligned right again.

I would like to get the bars so that they overlap each other in the middle (by about 25% – hence the 75% width) of the page, but if the window is then resized the bars need to stay static in the middle of the page, but stretch so they resize to keep aligned to the very edge of the page.

I have an example of the initial setup here: http://jsfiddle.net/headshot_harry/LsNby/2/

But as you can see, the bars stay aligned to the edge of the page when the window is resized, but they are not static in the middle. I need them to resize or “stretch” whilst keeping the overlap in the middle of the screen intact.

Code below:

HTML

<div id="headerBar1"></div>
<div id="gap"></div>
<div id="headerBar2"></div>
<div id="gap"></div>
<div id="headerBar3"></div>
<div id="content"></div>​

CSS

#gap {
    width: 100px;
    height: 3px;
    border: 0px solid black;
}

#content {
    width: 600px;
    margin: 10px auto;
    background: #ccc;
    border: 1px solid black;
    height: 100px
}

#headerBar1 {
    height: 40px;
    background: blue;
    width: 400px;
    margin-left: auto;
}
#headerBar2 {
    height: 40px;
    background: blue;
    width: 400px;
}

#headerBar3 {
    height: 40px;
    background: blue;
    width: 400px;
    margin-left: auto;
}

​

  • 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-15T17:06:13+00:00Added an answer on June 15, 2026 at 5:06 pm

    I think you need to use % instead of px

    http://jsfiddle.net/headshot_harry/LsNby/2/

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

Sidebar

Related Questions

I want to create a page with a horizontal centered content block that reaches
I want to create a horizontal scrolling field at the top of a UITableView
i want create a custom json data from the mssql 2008 results so that
I want to create a layout in which two bars , one at top
I want to create an Android application that has a MapView at the top
Is there a plugin for jQuery that will create this effect? http://zipbolt.com.au/ I want
I want to create a TextView that does NOT wrap text, and allow vertical/horizontal
Goal I want to create a web app with a horizontal GUI bar that
If I want to create a horizontal line of asterisks that is decided by
I want to create a horizontal swiping effect using jQuery Mobile. After doing a

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.