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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:55:37+00:00 2026-06-01T10:55:37+00:00

I have an image on a webpage. It’s a pretty big image, however. It’s

  • 0

I have an image on a webpage. It’s a pretty big image, however. It’s 6144*768. In actuality, it is a series of 6 images mushed together.

I read that it’s better practice to load this one image instead of loading 6 images. I’ve found this to be true as well, when I used tables and CSS.

However, when I set this image as the source of an image element and then set the size of the image element to 1024*768, the image is squished. Ack!

How can I get this image to be not-squished by using only Javascript? Also, how could I move the background of the image?

[example: Imagine a really long strip of paper. Then, place a small cut-out rectangle of paper over that somewhere on the strip of paper, so that you can only see the part of the strip that is inside the rectangle. This is what I want to do]

  • 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-01T10:55:40+00:00Added an answer on June 1, 2026 at 10:55 am

    Place the image inside a container element, and set the overflow to hidden using CSS.
    Leave the image as it is and it won’t be squished

    HTML

    <div id="imgContainer">
        <img src="myImage.jpg" alt="" width="6144" height="768" />
    </div>
    

    CSS

    #imgContainer
    {
        height: 1024px;
        width: 768px;
        overflow: hidden;
    }
    

    Then to move the image use negative values for the CSS style margin-left.

    #imgContainer img
    {
        margin-left: -1024px;
    }
    

    You can do this with jQuery as follows

    $("#imgContainer img").css("margin-left", "-1024px")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image on my webpage as follows: <img id=k4Tbx6luuHmP01dpI4BRZw== src=/thumbnail/k4Tbx6luuHmP01dpI4BRZw==> However, when
I have a problem that I have two downloaded images on my webpage(second image
In one webpage, I have a big image to load and other contents. Sometimes
I have an image on my webpage in which I want to have text
I have an image on a webpage which is being dynamically generated by a
I have a webpage where I want the user to see a new image
Scenario: You have an ASP.Net webpage that should display the next image in a
At my webpage I have links to images like this: img/123456765/mypicture.jpg (<img src=img/123456765/mypicture.jpg />)
I have a web page that includes a bunch of images. Sometimes the image
I have a two sprite images. One image contains the body of a rounded

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.