This article will explain in detail how to set the background attribute in CSS. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Background related attributes mainly include:
background-color background color
#p1 { width: 300px; height: 300px; background-color: blue; /*默认是transparent透明的*/ /* background-color: transparent; */ background-image: url(Images/2.jpg); background-repeat: no-repeat; /*不平铺,默认是水平垂直平铺*/ /* background-repeat: repeat-y; */ /* background-repeat: repeat-x; */ /* background-position: right bottom; */ background-position: 10% center; background-attachment: fixed; }
p { width: 100%; height: 300px; background-color: rgba(0, 0, 0, 0.6); }
p { width: 100%; height: 300px; background: url(Images/2.jpg) no-repeat left top, url(Images/3.jpg) no-repeat right bottom blue; }
CSS basic video tutorial , CSS3 video tutorial !
The above is the detailed content of How to set background properties in CSS (detailed explanation). For more information, please follow other related articles on the PHP Chinese website!