Background vs background-image? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Background vs background-image?

What’s the difference between background and background-image? Thanks 😃

10th Jul 2019, 4:38 AM
Gabriëlla
1 Answer
+ 5
Background is a shortstand for all background properties. for: - background-color - background-image - background -repeat - background-attachment - background-attachment - background-position. Instead of declaring all of those, you can just put them in one declaration using "background". background: #000000 url("img_") no-repeat right top; //remember they have to be in order of how i listed them above. and background-image only takes care of background image. Background-image:url("img"). ✔️
10th Jul 2019, 4:50 AM
Ginfio
Ginfio - avatar