Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>Example</title> <style> .background { width: 220px; height: 150px; padding: 10px; background-color: yellowgreen; background-image: url(/pix/samples/bg1.gif); border: 20px solid rgba(0,0,0,0.3); background-size: contain; } </style> <div class="background"> Testing the <code>background-size</code> property! </div> <p>Change the value to see the difference between the <code>contain</code> and <code>cover</code> keywords, as well as providing an explicit size.</p>