i need an HTML code for creating a background image?

web design

Public Comments

  1. This article provides HTML background image code - code for setting a background image on an HTML element. Perhaps more importantly, it also provides the CSS code for a background image. The CSS method is recommended as it is more powerful, besides, the HTML method is deprecated. HTML method (deprecated) To set a background image for your page in HTML, do something like this: <body background="/images/image_name.gif"> CSS method (recommended) As mentioned, CSS is more powerful for setting background images. You can set a background image for any element, plus you can specify its position, whether it should repeat, how it should repeat etc. To set a background image using CSS, prevent it from repeating, and position it in the center of the page, do something like this and place it in between the document's head tags: <style> body { background-image: url("/images/image_name.gif"); background-position: 50% 50%; background-repeat: no-repeat; } </style> Even better still, you can use the CSS background tag to set all the background properties at once. Therefore, we could rewrite the above code to this: <style> body { background: url("/images/image_name.gif") 50% 50% no-repeat; } </style>
  2. For html you put it in your body tag. Example: <body background="path/url"> With this question it sounds like your new to web design, and I can suggest a website that can help you learn a few things. http://www.w3schools.com On that website you can start out learning HTML. It won't be your end all answer, it is more like getting your foot in the door in learning it, but it's what I used when I started, and here I am now, http://www.irmatt.com I used HTML and PHP, all in notepad except for the buttons and banner, that was done in adobe flash.
Powered by Yahoo! Answers