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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:09:50+00:00 2026-06-06T13:09:50+00:00

Hey guys I simply cannot get this to work. I have some content that

  • 0

Hey guys I simply cannot get this to work.

I have some content that is centred on the page using the margin: auto; “trick”.

In this content I have an image. I need to make a color bar coming under the image continuing out to the sides of the browser. On the right side I need it to look like its coming up onto the image.

I have made this picture to try an graphically show what I mean: image

As you can see the bar runs from the left to the right side of the browser. The centred image is just placed on top of it and then an image positioned on the top of the image. But I haven’t been able to get this working. Any one who would give it a go?

I tried positioning the bar relative and z-index low. This worked but the bar keep jumping around in IE 7-8-9. Centring the image wasn’t easy either and placing that smaller image on top was even harder. It wouldn’t follow the browser if you resized it. The problem here is that the user have to be able to upload a new picture so I cant just make a static image.

Please help I am really lost here

EDIT:

Tried the example below but when I run the site in IE 7-8-9 I have different results. link

  • 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-06T13:09:53+00:00Added an answer on June 6, 2026 at 1:09 pm

    I have made a jsFiddle which should work in Chrome and IE7-9: http://jsfiddle.net/7gaE9/

    HTML

    <div id="container">
    <div id="bar1"></div>
    <img src="http://placekitten.com/200/300"/>
    <div id="bar2"></div>
    </div>​
    

    CSS

    #container{
       width: 100%;
        margin: 0 auto;   
        background-color: red;
        text-align: center;
        position: relative;
    }
    #bar1{
        background-color: blue;
        position: absolute;
        top: 50%;
        right: 0;
        z-index: 1;
        height: 30px;
        width: 40%;
    }
    #bar2{
        background-color: blue;
        top: 50%;
        left: 0;
        z-index: 3;
        height: 30px;
        width: 40%;
        position: absolute;
    }
    img{
        text-align: center;
        z-index: 2;
        position: relative;
    }
    ​
    ​
    

    The key here is that the container is positioned relative, thus enabling absolute positioning of the child elements in relation to their parent. Use z-index to control how the elements are stacked.

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

Sidebar

Related Questions

Hey guys, I'm trying to get threading to work in ASP.NET but for some
Hey guys I have my script here that is supposed to do some stuff
Hey guys I have an assigned array from mysql results and I simply want
hey guys having this really simple problem but cant seem to figure out have
Hey guys, this is simple but I can't make it workn... blah! I have
Hey guys I have a quick question, I have a dialog box that has
hey guys, we have a loop that: 1.Loops over several thousand xml files. Altogether
Hey guys I have a simple create method with some validations and whenever the
Hey guys and gals I'm having some major issues trying to get my application
Hey guys i have a ListActivity... a very simple at that... and it keeps

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.