• How To?
  • Tips ‘n Tricks
  • WordPress
  • Snippets
  • Software
    • Browsers
    • Downloads
  • Web
  • Tools
    • Character Counter
    • chmod Calculator
    • Entities Encoder
    • Live HTML Editor
    • My IP
  • Contact
Twitter Facebook Google+ RSS
You are here: SumTips » Snippets » CSS Snippets » Scaleable Full Screen Background Image with CSS3

Scaleable Full Screen Background Image with CSS3

Posted on November 22, 2011 by Renji | Short URL: http://sumtips.com/?p=5967

With the background-size property in CSS3, we can get a full page scaleable background image.

Here’s the CSS code:

html {
    background: url(images/background.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

Background image is centered, automatically resized according to browser size, and retains the aspect ratio.

The background-size property is supported in Chrome, IE9+, Firefox 4+, Opera 10+, and Safari 5+. Using vendor prefixes, we can get this to work on Firefox 3.6+, Opera 9.5+ and Safari 3+.


Tweet

Related posts:

  • Set a Custom Background Image on Google+ with Layouts for Google Plus
  • Customize Facebook Homepage with Background Image
  • Set Favorite Websites & Custom Background Image on Chrome New Tab Page
  • Hover Mouse Over Image to View Full Size
  • Set Any Image As A Wallpaper From Google Chrome
Categories: CSS Snippets
Show Link URL from HREF Attribute Using CSS

  • Get Updates via Email

  • Recent Posts

    • CMS2CMS: Migrate Site from Drupal or Joomla to WordPress
    • WordPress: Add Preview Button in Distraction Free Writing
    • How to Activate or Deactivate Individual Jetpack Modules
    • Windows 8: Auto Update Defender with Windows Update Disabled
    • Automatically Start and Close Programs at Specific Time
    • How to Copy Code from Notepad++ with Syntax Highlighting
  • Random Posts

    • Convert All Your Files Online in 3 Steps
    • Google Testing New AdSense Beta Interface
    • Force Download Files on your Website using htaccess
    • 5 Free Tools to Keep All Your Software Updated
    • The Google Start Page:Gpanion
    • Sign Up for Free Google Apps Account & Add Personal Domain
  • Categories

    • Blogging
    • Games
    • Google
    • How To?
    • Linux
    • Microsoft
      • Windows
    • Miscellaneous
    • Phone
    • Snippets
      • AutoHotkey Snippets
      • CSS Snippets
      • htaccess Snippets
      • JavaScript Snippets
      • PowerShell Snippets
      • WordPress Snippets
    • Social
    • Software
      • Browsers
    • Tips 'n Tricks
    • Wallpapers
    • Web
© SumTips. Contact | Sitemap | Privacy Policy