Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <style> div { width: 100%; height: 400px; background-image: url('/wp-content/uploads/2015/06/img_flowers.jpg'); background-size: cover; border: 1px solid red; } </style> </head> <body> <p>调整浏览器大小查看效果。</p> <div></div> </body> </html>