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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:15:58+00:00 2026-06-03T16:15:58+00:00

I am having issues horizontally centering my slideshow images so that they are central

  • 0

I am having issues horizontally centering my slideshow images so that they are central on all screen sizes / resolutions.

The HTML looks as such

<div id='banner'>
    <div class='slides_container'>
        <div>
            <a href='#'><img src='images/banner.png'></a>
        </div>
        <div>
            <a href='#'><img src='images/banner2.png'></a>
        </div>
    </div>
</div>

And the CSS to match this is:

#banner {
    width:100%;
    margin-bottom:50px;
}

.slides_container {
    width:100%;
    height:500px;
}

.slides_container div {
    width:1100px;
    height:500px;
    text-align:center;
}

I am really struggling here to get the image to center on all screen sizes since padding and margins don’t work I am in need of a different method!

Any replies are extremely appreciated.

  • 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-03T16:15:59+00:00Added an answer on June 3, 2026 at 4:15 pm

    You should make sure the .slides_container div is centered within its parent, i.e.

    .slides_container div { 
      margin: 0px auto; // center
      width:1100px; 
      height:500px; 
      text-align:center; 
    } 
    

    If that doesn’t work, you need to make sure the parent container is width 100% of the page.

    If the parent is not width 100% of the page, the parent needs to have this property also:

    .slides_container {
        margin: 0px auto;
    }
    

    If that doesn’t work, then you need to make sure its parent is 100% width of the page.

    Hope this helps.

    Edit

    I took a look at it in FireBug, and it was immediately apparent that the slide container is set to 3800px wide, and the div inside doesn’t have a width set. If you set the div inside the slide container to 100% width, it will cause it to become 3800px wide, so that won’t work.

    By the nature of the script you are using, it is using an abolute-positioned div to work. So margin: 0px auto won’t work here.

    The solution is a bit of javascript to run onload, and on window resize, to set that div which holds the image to the width of your browser window, and text-align: center. So for example, since I have 1280px wide monitor, this centers the image for me:

    .slides_control div {
        width: 1280px;
        text-align: center;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking to make a horizontally layed website but I am having issues
Having issues getting links that match a given word to display using Xpath and
Having issues with Twitter Bootstrap responsive navigation. The best way to explain this is
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
Am having issues with printing different sized PDF's using GhostScript (V9.05). The PDF in
Still having issues with this problem. Please help if you can. So I am
Im having issues getting this to work, maybe its not even possible? I have
Im having issues vertically positioning text inside of a text input field in Firefox.
I am having issues with networking being very slow.. For testing purposes, I tried
I am having issues passing a dynamic parameter to a JavaScript function using innerHTML.

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.