Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- body {
- background-image: url("http://i.imgur.com/g4bPBbf.jpg");
- background-repeat: no-repeat;
- background-position: right top;
- margin-right: 400px;
- }
- </style>
- </head>
- <body>
- <h1>Hello World!</h1>
- <p>
- Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing... Hello World... W3School... CSS... Testing...
- </p>
- <p>W3Schools background no-repeat, set position example.</p>
- <p>Now the background image is only shown once, and positioned away from the text.</p>
- <p>In this example we have also added a margin on the right side, so the background image will never disturb the text.</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement