fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <style> div { width: 100%; height: 400px; background-image: url('/images/htmlcss/img_flowers.jpg'); background-repeat: no-repeat; background-size: contain; border: 1px solid red; } </style> </head> <body> <p>调整浏览器大小查看效果。</p> <div></div> </body> </html>
运行结果