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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:53:16+00:00 2026-06-06T17:53:16+00:00

This is a follow-on from a previous SO question Anchoring CSS Repeating Background Image

  • 0

This is a follow-on from a previous SO question Anchoring CSS Repeating Background Image but sufficiently different to treat as a separate question.

The jsFiddle http://jsfiddle.net/By2xj/ demonstrates the concept. I have a banner image (center) which then requires repeating images on the left and right which will display and repeat depending on the width of the browser window. The proviso is that the left and right images must be locked to the edge of the center banner image. You can see this effect if you expand the jsFiddle Result window – the left and right repeating images always remain locked to the side of the center banner image and expand out from that point.

So all this is working, but I have used a table to achieve this effect, as the CSS suggested in the previous Stack Overflow question didn’t fully work and was a bit browser dependant, particularly not playing with older browsers.

With this table based solution, I would like to always keep the centre banner image centered, even when the browser width is smaller than the banner. If you reduce the size of the jsFiddle Result window you will see that when the browser width is smaller than the banner, the banner sticks to left-alignment rather than being centered.

So my question is how can I always keep the center banner center aligned (or perhaps, more correctly, the entire table center aligned), even when the browser width is smaller than the banner width (and containing table cell)?

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

    It’s a bit cheat but, I hope what you’re looking for.

    http://jsfiddle.net/By2xj/8/

    what’s happening is, I’m creating a div in that middle cell, and position absolute, after that, centering it to screen. that div will remain centered all times, regardless size of the browser window.

    for the record:

    <table id="banner-table">
        <td id="left-image"></td>
        <td id="center-image"><div></div></td>
        <td id="right-image"></td>
    </table>​
    

    css:

     #banner-table {
    
        width: 100%;
        height: 200px;
        padding: 0;
        margin: 0;
        border-collapse: collapse;
        table-layout: fixed;
    }
    
    #left-image {
        background-image: url(http://www.dummyimage.com/100x200/ff0303/ffffff.png&text=Left);
        background-position: right;
        background-repeat: repeat-x;
    }
    
    #center-image {
    
        width:400px;
    
    
    }
    #center-image div {
        top:0; left:50%;
        margin-left:-200px;
        width:400px;
        height:200px;
    
        position:absolute;
        background-image: url(http://www.dummyimage.com/400x200/0021fa/ffffff.png&text=Center);
        background-position: center;
        background-repeat: no-repeat;
    }
    #right-image {
        background-image: url(http://www.dummyimage.com/100x200/1f9900/ffffff.png&text=Right);
        background-position: center center;
        background-repeat: repeat-x;}​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow on from my previous question although this is about something
All, this is a follow up from a previous question here: C# formatting external
Note that this is a follow-up question from my previous one: How to memorize
This is something of a follow up from a previous question . The requirements
This is somewhat a follow up to a previous question - but I've distilled
(This is a follow-up from this previous question ). I was able to successfully
This is a follow-on from a previous question, in the implementation, I have two
This is a follow-on from a previous question I had: How to decouple my
OK, this question is actually a follow-up question from my previous one: What would
This is a follow up question from my previous one found here I need

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.