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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:07:18+00:00 2026-06-06T11:07:18+00:00

I currently have the following CSS (called splash.css): html { background:url(splash.jpg) center no-repeat; background-size:auto

  • 0

I currently have the following CSS (called splash.css):

html { 
    background:url(splash.jpg) center no-repeat;
    background-size:auto 100%;
}

And the following HTML:

<!DOCTYPE html>
<HTML>
    <HEAD>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
        <TITLE>Test</TITLE>
        <link href="splash.css" rel="stylesheet" type="text/css" media="screen" />
    </HEAD>
    <BODY>
    </BODY>
</HTML>

I’m trying to get the background image called splash.jpg to always have the same height as the browser window, and to resize it (keeping its aspect ratio) and allow some of the width to remain outside the browser window. In addition, the background must be centered about the browser window.

Currently I would expect my CSS to do exactly what it’s supposed to do. I’ve set the background to be horizontally and vertically aligned to the center, and I’ve set it to the image it’s supposed to be. I’ve also set the background-size to auto 100% – which, according to Mozilla Developer Network, resizes the image exactly like I want it to be resized.

If the background-size has one auto component and one non-auto component:
If the image has an intrinsic proportion, then render it using the specified dimension, and compute the other dimension from the specified dimension and the intrinsic proportion. If the image has no intrinsic proportion, use the specified dimension for that dimension. For the other dimension, use the image’s corresponding intrinsic dimension if there is one. If there is no such intrinsic dimension, use the corresponding dimension of the background positioning area.

The problem I am facing is that the height of this huge, 1920×1080 image, appears to be around only 50px when I open the HTML in a browser window. The width also appears to be in the right ratio to the height.

At first, I felt it might be some sort of browser-dependent bug – but the page appears pretty much exactly the same in both Chrome and Firefox!

Note – Any other SIMPLE solutions are welcome. I don’t want this behavior to be Javascript dependent – but I don’t mind the solution working only in the latest versions of FF/Chrome.

  • 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-06T11:07:22+00:00Added an answer on June 6, 2026 at 11:07 am

    Add height: 100%; to your html styles.

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

Sidebar

Related Questions

I have the following CSS: body { margin-left:0px; margin-right:0px; margin-bottom:0px; margin-top:0px; background-image: url(../images/tile.png); background-repeat:
I currently have the following CSS: a.enabled:hover { background-color: #f9f9f9; border: 1px solid #ddd;
I currently have the following in my HTML document. <link REL=StyleSheet HREF=/stylesheets/home.css TYPE=text/css MEDIA=screen>
I currently have the following CSS for my 4 columns which might grow to
I currently have the following MySQL statement to replace the HTML entity for a
I have the following code. I have two background images for buttons - lightSquare.jpg
I currently have the following script using CSS Sprites that toggles between active and
I currently have a CSS <ul><li> dropdown menu that uses the following code. Unfortunately
I have the following HTML/CSS: #scrollpanel{height:100px;overflow-x:hidden;overflow-y:scroll;width:200px} <div id=scrollpanel> <div class=listing ref_1>...</div> <div class=listing ref_2>...</div>
I am currently styling an <input type='button'/> element with the following CSS: background: transparent

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.