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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:35:06+00:00 2026-06-07T21:35:06+00:00

I want the background image for a page to stretch to the full width

  • 0

I want the background image for a page to stretch to the full width and height. The challenge here is that it should leave out an area of 48 px at the top as well as at the bottom (those are header and footer areas and we don’t want this image to hide behind that). Also, I am trying to do it with css only (no javascript or client side code). CSS3 is ok.

Here is where I am so far. I have been able to get the top margin:

 background-image: url('images/image1.png')
background-repeat: no-repeat;
background-attachment:fixed;
background-position:  center 48px;  
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; 
  • 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-07T21:35:08+00:00Added an answer on June 7, 2026 at 9:35 pm

    Instead of using background-size, I would make a div with an image inside of it, and position it absolutely to the window, and then position everything you want on top of it relative, with a higher z-index. Background-size css property is not supported in the earlier versions of IE, only IE9+. Here is a tiny example:

    <body>
        <div class="bg-image">
            <img src="images/image-1.png" />
        </div>
        <div class="content">
            <p>this is your content</p>
        </div>
    </body>
    

    Then for CSS:

    .bg-image {
        position: absolute;
        width: 100%;
        height: auto; /*or 100%*/
        z-index: 1;
        padding: 48px 0px;
    }
    
    .bg-image img {
        width: 100%;
        height: 100%;
    }
    
    .container {
        position: relative;
        z-index: 2;
        top: 0px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to grab all elements on a page that have a css background-image.
I want to create a web page background image that fills the entire background,
I want to create a cover page that has text over a background image.
I have a web page where I want to switch the background image of
I want to have a UIImage as a background image on a UIView. Here
I want to set page background image my css code is- background:url(images/body_bg.jpg) repeat-x top;
I want to put a background (width = 1250px) centered on page, but the
I have an HTML page with a pink background image. I want to define
I have a background image that I want to repeat across (repeat-x) however when
I am creating a web page, where I have an image that I want

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.