Answers for "size of back ground image"

CSS
31

background image size css

#example1 {
  background: url(mountain.jpg);
  background-repeat: no-repeat;
  background-size: auto;
}

#example2 {
  background: url(mountain.jpg);
  background-repeat: no-repeat;
  background-size: 300px 100px;
}
Posted by: Guest on May-28-2020
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