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

  • Home
  • SEARCH
  • 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 874607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:07:51+00:00 2026-05-15T11:07:51+00:00

Is it possible to resize the background image of a webpage as the browser

  • 0

Is it possible to resize the background image of a webpage as the browser window is resized?

  • 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-15T11:07:51+00:00Added an answer on May 15, 2026 at 11:07 am

    The following code shows how to make a cross browser background image:

    <?xml version='1.0' encoding='UTF-8' ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <title>Cross Browser Background</title>
    
        <style type="text/css">
          html, body {
            height: 100%;
            margin: 0;
            padding: 0;
          }
    
          #background {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
          }
    
          #content {
            z-index: 1; /* The content should be above the background image */
    
            margin: 20px 30px;
            background-color: #000;
            color: #FFF;
            padding: 10px 15px;
    
            /* Just add some fancy transparency */
            opacity: .85; /* Standard: FF gt 1.5, Opera, Safari */
            filter: alpha(opacity=50); /* IE lt 8 */
            -ms-filter: "alpha(opacity=50)"; /* IE 8 */
            -khtml-opacity: .50; /* Safari 1.x */
            -moz-opacity: .50; /* FF lt 1.5, Netscape */
          }
        </style>
    
        <!-- IE6 sucks as usual - Add some special code for it -->
    
        <!--[if IE 6]>
          <style type="text/css">
            html {
              overflow-y: hidden;
            }
    
            body {
              overflow-y: auto;
            }
    
            #background {
              position:absolute;
              z-index:-1;
            }
    
            #content {
              position:static;
            }
          </style>
        <![endif]-->
      </head>
      <body>
        <img id="background" src="background.jpg" alt="" />
    
        <div id="content">
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc aliquam placerat justo, in tincidunt purus faucibus quis. Pellentesque facilisis mi id neque laoreet laoreet. Quisque quis metus vitae enim lacinia egestas eu at ipsum. Proin sed justo massa, non consequat lacus. Nullam pulvinar commodo egestas. Vivamus commodo ligula a turpis mattis facilisis. Vestibulum vel massa a lorem pulvinar varius nec ut justo. Donec hendrerit dapibus erat. Aenean interdum, lorem sit amet venenatis tincidunt, augue ipsum tincidunt velit, vel egestas nulla quam non quam. Mauris vulputate libero at purus auctor sed egestas magna vehicula.</p>
        </div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to position a background image at the bottom of the window
Is it possible to resize a background image on load using javascript? I don't
Is it possible I can resize a background image of a <li> of which
I would like to automatically resize div according the background-image size. Is that possible
Is it possible to resize an openGL window (or device context) created with wglCreateContext
Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
Possible Duplicate: Resize a picture to a fixed size How to resize an image
It's possible to write CSS that stretches a container's background image to fit the
The wetransfer website often has background images that scale when you resize the browser.
Possible Duplicate: Set size on background image with CSS? I need to find a

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.