Prev Demo
Background Image To Cover By Using Background-Size Property
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <meta name="viewport" content="width=device-width" initial-scale="1.0"> </head> <body> <style> p { width: 100%; background-image: url('http://techfunda.com/HTPictures/Generics/5-635942140823078493.jpg'); height:150px; background-size:cover; background-repeat:no-repeat; border:2px solid blue; } </style> <p></p> <div>Re size the browser to get the clear image from cover image</div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output