Loading Please Wait...

Logo Lynxsia IT Solutions

CSS Backgrounds

CSS Backgrounds

CSS allow us to handle background graphics of the elements. We can set color, image, size, etc. of the element. CSS has background or background-* properties for the background.

Background Color

Sets the background color of the selected element. Default is transparent

We can give any color value like name, HEX, HEXA, RGB, RGBA, HSL, HSLA, etc.

Syntax = background-color: red;

					 
        
          p{        
            background-color: red;
          }
        
      
Background Image

Sets the background image of the selected element. Default is none

Syntax = background-image: url("image.png");

					 
        
          div{        
            background-image: url("image.png");
          }
        
      
Background Attachment

Sets the position of background image of the selected element. Default is scroll

Syntax = background-attachment: fixed;

					 
        
          div{        
            background-attachment: fixed;
          }
        
      
Background Repeat

Sets how the background image is repeated of the selected element. Default is repeat

Syntax = background-repeat: no-repeat;

					 
        
          div{        
            background-repeat: no-repeat;
          }
        
      
Background Position

Sets the initial position of the background image of the selected element. Default is 0% 0%

Syntax = background-position: center;

					 
        
          div{        
            background-position: center;
          }
        
      
Background Size

Sets the size of the background image of the selected element. Default is auto

Syntax = background-size: contain;

					 
        
          div{        
            background-size: contain;
          }
        
      
Background Clip

Sets whether the background is underneath of border box, padding box, or content box. Default is border-box

Syntax = background-clip: padding-box;

					 
        
          div{        
            background-clip: padding-box;
          }
        
      
Background Origin

Sets origin of the background. Default is padding-box

Syntax = background-origin: content-box;

					 
        
          div{        
            background-origin: content-box;
          }
        
      
Background Blend Mode

Sets blending of background images and color of the element. Default is normal

Syntax = background-origin: luminosity;

					 
        
          div{        
            background-origin: darken;
          }
        
      
Background Shorthand

We can set multiple background properties in a single line using background property.

					 
        
          div{        
            background: url("image.png") #fd3ea4 no-repeat right top;
          }
        
      

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