Answers for "bg image size"

CSS
0

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;
Posted by: Guest on February-13-2022
0

make backgrond image smaller

/*The cover value specifies that the background image should be sized
so that it is as small as possible while ensuring that both dimensions
are greater than or equal to the corresponding size of the container.*/

background-size: cover;
Posted by: Guest on March-09-2021

Browse Popular Code Answers by Language