New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Background image using css
I have to put background image using css.Can I set height and width of this image? https://code.sololearn.com/WBj31OmiO0d8/?ref=app
2 Answers
+ 3
CSS background-image Property
https://www.w3schools.com/cssref/pr_background-image.asp
background-image: url("photographer.jpg"); /* The image used */
background-color: #cccccc; /* Used if the image is unavailable */
height: 500px; /* You must set a specified height */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
+ 2
Thank you SoloProg