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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:29:23+00:00 2026-05-31T16:29:23+00:00

I know this sounds somewhat counterintuitive, but let me explain what I am trying

  • 0

I know this sounds somewhat counterintuitive, but let me explain what I am trying to do.

I have a large element that serves as the background. It does not resize. It is often larger than the screen it is viewed on. Most of the content of this element (it’s just an image) is near the center. Let’s say that the only NECESSARY information is in the middle 800px, and the whole thing is 1600px wide.

Why is it wider than necessary? Because it fades pleasingly into the rest of the background and adds to the design of the site.

So I made the element fixed and used a standard trick to center it. It works perfectly on a large monitor. It stays centered, if some of it is a little too big, it doesn’t allow you to scroll over in order to see what is basically nothing. I like that.

But if the screen is too small, you can’t see it all. You can’t just set the min-width or min-height of the page because when you go to scroll, the background image stays in place, because it is fixed.

If there was a way to have a fixed element actually move with everything else when the page is scrolled, that would work perfectly, because I could specify the min-width to the size of the required elements of the image. That would work very well.

Otherwise, another solution would be to use some other form of positioning that allows for the prevention of being able to scroll to see the whole thing. Then, again, I could just set the whole with a minimum width, which would allow me to set exactly how much of the content is scrollable.

Is any of this possible? I feel like I am missing something simple. Ideally I would not have to resize any images, serve up multiple css sheets, or use any elaborate javascript or anything like that. Thanks for the help!

  • 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-05-31T16:29:24+00:00Added an answer on May 31, 2026 at 4:29 pm

    I have finally solved this problem after a ton of experimentation and the solution turned out to be basic CSS, which is awesome.

    I go into great detail illustrating this solution at my blog. Alternatively, here is the working demo.

    HTML

    <body>
     <div id="box">
      <div id="element"></div>
     </div>
    </body>
    

    CSS

    <style type="text/css">
    html, body {
     height:100%;
    }
    body {
     margin:0px;
     padding:0px;
     min-width:1000px; /*Set the width you want to be able to scroll to here*/
    }
    #element {
     height:100%;
     position:relative; /*This section centers your element*/
     left:50%;
     margin-left:-800px; /*Half the width of the image*/
     z-index:-9999; /*This part puts it behind everything, not needed if you aren't making a background*/
     background:url(image.jpg) no-repeat;
    }
    #box {
     height:100%;
     min-height:700px; /*Set the height you want to be able to scroll to here*/
     overflow:hidden; /*Needed due to centering with margins*/
    }
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this sounds kind of vague, but please let me explain- I'm starting
I know this sounds very dumb, but we have a client that sends out
I know this sounds knit picky but I have several custom controls that have
I know the question sounds silly, but consider this: I have an array of
I know this sounds like something I can google, but the truth is that
I know this sounds bizarre, but it is true. I have a simply WPF
This may sound somewhat stupid, but I have to know as I'm writing a
I know this sounds backwards, but I have to convert this from C# to
I know the question sound somewhat stupid, but i have this scenario. Context I
I know this sounds like a homework assignment, but it isn't. Lately I've been

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.