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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:35:36+00:00 2026-06-01T23:35:36+00:00

I need to center a image of width 1400px inside a width 960px div,

  • 0

I need to center a image of width 1400px inside a width 960px div, and hide 220px for left and 220px for right.

enter image description here

<div style="width:960px;">
    <img src="src" style="width:1400px" />
</div>
  • 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-01T23:35:37+00:00Added an answer on June 1, 2026 at 11:35 pm

    This is pretty simple with the following CSS:

    #wrapper {
        position: relative;
        overflow: hidden;
        width: 960px;
        height: 400px;
    }
    #wrapper img {
        position: absolute;
        left: -220px;
        width: 1400px;
    }
    

    If you don’t know the height, you would probably want to use either a negative left margin, or position: relative.

    #wrapper {
        overflow: hidden;
        width: 960px;
    }
    #wrapper img {
        position: relative;
        left: -220px;
        display: block;
    }
    

    If the size of your image is dynamic, you could try something like this:

    #wrapper {
        width: 960px;
        overflow: hidden;
    }
    #wrapper .inner {
        width: 10000px;
        position: relative;
        left: -4520px; /* 5000 minus half the wrapper width */
    
    }
    #wrapper .inner img {
        display: block;
        margin: 0 auto;
    }
    

    Note that this requires an extra wrapper, .inner.

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

Sidebar

Related Questions

I need to center html content inside a div class=partners (top div with 2
Please help me center a div that does not have a predefined width, inside
I need to center align images (variable width and height) inside block level elements
Some progrees from my old question ( Center and hide image, fitting div size
I need to center a CSS menu that has an unknown width. I found
I have an image inside a span tag, the span has a set width
I ve tried to set the left-right borders as a background-image with repeat-y=100%, but
I need to center some floated divs inside a container. The code I'm using
I need to create a clickable div with an image (of variable size, but
I have a div whith contains another divs with image. I need to have

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.