Answers for "set background image div"

CSS
124

css background image

background-image: url("image.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
Posted by: Guest on April-07-2020
2

div background image

#avatar {
    /* This image is 687 wide by 1024 tall, similar to your aspect ratio */
    background-image: url('http://i.stack.imgur.com/Dj7eP.jpg');
    
    /* make a square container */
    width: 150px;
    height: 150px;

    /* fill the container, preserving aspect ratio, and cropping to fit */
    background-size: cover;

    /* center the image vertically and horizontally */
    background-position: top center;

    /* round the edges to a circle with border radius 1/2 container size */
    border-radius: 50%;
}
Posted by: Guest on February-17-2021
4

make image background of div

background-image: url("photographer.jpg");
Posted by: Guest on April-03-2020
17

background image css

html,body {
  background-image: url("your.picture");
}
Posted by: Guest on April-25-2020
0

adding background image to a div css

css background image
Posted by: Guest on October-20-2021

Code answers related to "set background image div"

Browse Popular Code Answers by Language