css3 background-size property
Translation results:
background
UK[ˈbækgraʊnd] US[ˈbækˌɡraʊnd]
n. (painting, etc.) background; background color; background information; soundtrack
Plural: backgrounds
size
## English[saɪz] 美[saɪz] n. Scale; size, size; glue, paste Paste; huge, large number vt. Arrange by size; change the size of; apply glue, sizing; apply paint adj. Third person singular of a certain size : sizes Plural: sizes present participle: sizing past tense: sized past participle: sizedcss3 background-size propertysyntax
Function: Specifies the size of the background image.
Note: Before CSS3, the size of the background image was determined by the actual size of the image. In CSS3, the size of the background image can be specified, which allows us to reuse the background image in different environments.
In CSS3, you can set the size of the background image through the background-size attribute, set the image size through the length value or percentage, or scale the image through cover and contain
css3 background-size propertyexample
<!DOCTYPE html> <html> <head> <style> body { background:url(http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg); background-size:63px 100px; -moz-background-size:63px 100px; /* 老版本的 Firefox */ background-repeat:no-repeat; padding-top:80px; } </style> </head> <body> <p>上面是缩小的背景图片。</p> <p>原始图片:<img src="http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" alt="Flowers"></p> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance
Popular Recommendations
- Go Context — TODO() vs Background() No more confusing!
- What Are Google Drive File Size Limit & Upload Size Limit?
- How JavaScript Works in the Background: Understanding Its Single-Threaded Nature and Asynchronous Operations
- Do you use text-size-adjust in your global styles?
- United States Token Platform Market Size, Share, Analysis, and Forecast Report 2023-2030
- Global Coin-Operated Laundry Machines Market Size, Share, Revenue, Growth Rate, and Forecast to 2031