Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

background-size

/* Keyword values */
background-size: cover;
background-size: contain;

/* One-value syntax */
/* Only width of image (height is 'auto') */
background-size: 70%;
background-size: 4rem;
background-size: 50px;
background-size: auto;

/* Two-value syntax */
/* first: width, second: height */
background-size: 70% auto;
background-size: 4rem 25%;
background-size: auto 10px;
background-size: auto auto;

/* Multiple background images */
background-size: auto, auto; /* Not the same as 'auto auto' */
background-size: 70%, 20%, 25%;
background-size: 6rem, auto, contain;
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+6 =