Loading Please Wait...

Logo Lynxsia IT Solutions

CSS Background Shorthand

CSS Background

CSS background property is used to set multiple background properties in a single line such as repeat, size, color, image, etc.

Valid Background Properties

The background property is a shorthand for the following properties.

You can arrange the above CSS background properties in any order and even exclude any of the them.

The size property must be include immediate after the position property separated by slash (/). For example position/size, top/contain, top left/90%, etc.

If we define origin property it will also define clip property as well and vice versa.

					 
        
          /* only color */
          background: #ffdd1a;

          /* color and image */
          background: #ffdd1a url("image.png");

          /* image and repeat */
          background: url("image.png") repeat-x;

          /* origin, clip, and color */
          background: content-box #000000;

          /* position/size, repeat, image */
          background: left 5% / 15% 60% repeat-x url("image.png");

          /* multiple backgrounds separated by comma */
          background: left 5% / 15% 60% repeat-x url("image1.png"), top / cover repeat-x url("image2.png");
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved