СSS: background-image


/ Published in: CSS
Save to your folder(s)

It determines background image for the element. If the background color is specified for the element at the same time it will be shown while the background image will have been downloaded fully. The same will happen if the image is inaccessible or their demonstration in the browser is switched off. When there are transparent areas in the image you can see the background color through them.


Copy this code and paste it in your HTML
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  5. <title>background-image</title>
  6. <style type="text/css">
  7. BODY {
  8. background-image: url(images/bg.jpg); /* Path to the background image */
  9. background-color: #c7b29a; /* Background color */
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <p>...</p>
  15. </body>
  16. </html>

URL: http://phpforms.net/tutorial/tutorial.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.