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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:28:58+00:00 2026-06-01T17:28:58+00:00

Some progrees from my old question ( Center and hide image, fitting div size

  • 0

Some progrees from my old question (Center and hide image, fitting div size)

#slideshow {
    height: 550px;
    width: 1400px;
    overflow: hidden;
}
.slide {
    // NEED TO BE ABSOLUTE POSITIONED. If I comment the line, all work as expected, but slideshow don´t slide.
    position: absolute;
}
.slide img {
    height: 550px;
    left: 50% !important;
    margin-left: -700px;
    position: absolute;
}


<div id="slideshow">
    <div class="slide"><img src="http://di20studios.com/2012/royalpack/images/banners/af_banner_rp_01.jpg" /></div>
    <div class="slide"><img src="http://di20studios.com/2012/royalpack/images/banners/af_banner_rp_01.jpg" /></div>
    <div class="slide"><img src="http://di20studios.com/2012/royalpack/images/banners/af_banner_rp_01.jpg" /></div>
    <div class="slide"><img src="http://di20studios.com/2012/royalpack/images/banners/af_banner_rp_01.jpg" /></div>
</div>

What I expect?
Expect image centered on window. If resolution is less then image, left and right of images will be hidden.

enter image description here

Sorry my English, and thanks!

  • 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-01T17:28:59+00:00Added an answer on June 1, 2026 at 5:28 pm

    This can be achieved using a simple hack. You can align a div to the center of the page that has 1px width, and then put the image in that div. You then set the margin-left of that image to be half of the images width.

    See this example (I have left the background colour of the central div as red so you can see)

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

Sidebar

Related Questions

Some one asked about How to connect to SQL server database from JavaScript? and
I was wondering, I want to report some form of progress from my swing
I have an activity that gets some data from the internet in background while
I got some question is using ASIHTTPRequest to tracking Upload/Download progress This is the
I'm having some issues with the old Cannot make a static reference to a
I am in the middle of upgrading an old Rails and PostgreSQL app from
I have a perl script that grabs some files from a remote server and
Hi I am using HtmlAgilityPack to scrap some data from web using c# .
This is NOT a question on plain old boring customization; I actually want to
I have made some progress with the DataList and UserControl this morning but I

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.