ZVON > References > CSS1 Reference

Property: background-position
Values: <percentage>, <length>, top, center, bottom, left, center, right
Initial: 0% 0%
Inherited: no

If a background image has been specified, the value of 'background-position' specifies its initial position.

With a value pair of '0% 0%', the upper left corner of the image is placed in the upper left corner of the box that surrounds the content of the element (i.e., not the box that surrounds the padding, border or margin). A value pair of '100% 100%' places the lower right corner of the image in the lower right corner of the element. With a value pair of '14% 84%', the point 14% across and 84% down the image is to be placed at the point 14% across and 84% down the element.

With a value pair of '2cm 2cm', the upper left corner of the image is placed 2cm to the right and 2cm below the upper left corner of the element.

If only one percentage or length value is given, it sets the horizontal position only, the vertical position will be 50%. If two values are given, the horizontal position comes first. Combinations of length and percentage values are allowed, e.g. '50% 2cm'. Negative positions are allowed.

One can also use keyword values to indicate the position of the background image. Keywords cannot be combined with percentage values, or length values. The possible combinations of keywords and their interpretations are as follows:

Examples:

      BODY { background: url(banner.jpeg) right top }    /* 100%   0% */
      BODY { background: url(banner.jpeg) top center }   /*  50%   0% */
      BODY { background: url(banner.jpeg) center }       /*  50%  50% */
      BODY { background: url(banner.jpeg) bottom }       /*  50% 100% */
      

If the background image is fixed with regard to the canvas (see the 'background-attachment' property above), the image is placed relative to the canvas instead of the element. E.g.:

      BODY { 
        background-image: url(logo.png);
        background-attachment: fixed;
        background-position: 100% 100%;
      } 
      

In the example above, the image is placed in the lower right corner of the canvas.


Examples: 1:1 2:1 3:1 5:2 11:7



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
water softener MSN Alojamiento Web UNLIMITED Web Hosting by HostDepartment UK Domain Names
UK Domain Names VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE