Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Der Titel des Dokuments</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>Ein Beispiel für die Eigenschaft Background-origin</h2>
<p>Hier ist background-origin auf "padding-box" gesetzt, das ist der Standardwert für diese Eigenschaft.</p>
<div class="example1">
<h2>Hallo Welt!</h2>
<p> Ein Absatz zum Beispiel.</p>
</div>
<p>Here the background-origin is set to "content-box".</p>
<div class="example2">
<h2>Hallo Welt!</h2>
<p> Ein Absatz zum Beispiel.</p>
</div>
</div>
</body>
</html>