Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Aug 2003
    Posts
    194
    Member #
    2782
    Hi Everyone,
    I have a website with a background image. I want this background image to shrink/enlarge horizontally only according to the browser's size.

    Here is the CSS I have:
    Code:
            background-image:url("/images/bgwave.jpg");
            background-repeat: no-repeat;
            background-size: 100%;
            -o-background-size:100%; /* Opera */
            -webkit-background-size:100%; /* Safari */
            -khtml-background-size:100%; /* Konqueror */
    This code works in Firefox, Opera and Safari, but in Chrome it is enlarging it vertically too. Is there a special CSS I have to use to get it to appear right in Chrome? According to w3schools.com Chrome supports background-size.

    Thanks in advance.

  2.  

  3. #2
    Senior Member kralcx's Avatar
    Join Date
    Jan 2010
    Location
    3rd Planet from the Sun
    Posts
    140
    Member #
    20799
    Liked
    18 times
    I don't know if this will solve your problem; however vendor specific code goes before standard code. In other words this:
    -o-background-size:100%
    -webkit-background-size:100%
    khtml-background-size:100%

    comes before:
    background-size:100%
    Abstract likes this.

  4. #3
    Senior Member
    Join Date
    Aug 2003
    Posts
    194
    Member #
    2782
    That worked! Thanks kralcx.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

html background-size compatibility

Click on a term to search for related topics.
All times are GMT -6. The time now is 08:52 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com