Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>The title of the document</title> <style> .example1 { border: 5px dashed #666; padding: 35px; background: url("/uploads/media/default/0001/01/b408569013c0bb32b2afb0f0d45e93e982347951.jpeg"); background-repeat: no-repeat; background-origin: padding-box; } .example2 { border: 5px dashed #666; padding: 35px; background: url("/uploads/media/default/0001/01/b408569013c0bb32b2afb0f0d45e93e982347951.jpeg"); background-repeat: no-repeat; background-origin: content-box; } </style> </head> <body> <h2>Background-origin property example</h2> <p>Here the background-origin is set to "padding-box" which is the default value of this property.</p> <div class="example1"> <h2>Hello world</h2> <p> Some text for example.</p> </div> <p>Here the background-origin is set to "content-box".</p> <div class="example2"> <h2>Hello world</h2> <p> Some text for example.</p> </div> </body> </html>