Set the background image position to start from the upper left corner of the content-box. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the background image position to start from the upper left corner of the content-box.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--  w  w w.j ava  2  s.c o m-->
    border: 10px solid black;
    padding: 35px;
    background: url(https://www.java2s.com/style/demo/Opera.png);
    background-repeat: no-repeat;
    background-origin: content-box;
}
</style>
</head>
<body>

<div>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>

</body>
</html>

Related Tutorials