PNLdev
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
En
English
فارسی
En
English
فارسی
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
Run
<!DOCTYPE html> <html> <head> <style> #example1 { border: 2px solid black; padding: 25px; background: url(mountain.jpg); background-repeat: no-repeat; background-size: auto; } #example2 { border: 2px solid black; padding: 25px; background: url(mountain.jpg); background-repeat: no-repeat; background-size: 300px 100px; } </style> </head> <body> <h2>background-size property example</h2> <h3>background-size: auto (default):</h3> <div id="example1"> <h3>PNLdev.com</h3> <p>The background image is displayed in its original size.</p> </div> <h3>background-size: 300px 100px:</h3> <div id="example2"> <h3>PNLdev.com</h3> <p>Here, the background image is displayed in it's Set values.</p> </div> </body> </html>