|
HTML Home
Create a Website HTML TutorialHTML Tutorial HomeAbout HTML Getting Started HTML Elements HTML Formatting HTML Attributes HTML Colors HTML Links HTML Images HTML Meta Tags HTML Comments HTML Forms HTML Tables HTML Image Maps HTML Frames HTML Entities HTML Layouts HTML Styles HTML Scripts HTML Website Templates Website Hosting Summary HTML Code GeneratorsHTML Code GeneratorHTML Table Generator Marquee Generator Music Code Generator HTML Text Generator Text Box Generator Free HTML CodesHTML Background CodeHTML Comment Box Codes HTML Font Codes HTML Picture Codes HTML Marquee Code HTML Music Codes More Codes... HTML ReferenceComplete HTML Tag ListHTML Special Characters Hex Color Codes HTML Help Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |
HTML Background Image CodeThis 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:
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:
Enjoy this website?
Oh, and thank you for supporting Quackit! |
FREE Hosting!With every domain name you register with ZappyHost, you get FREE (ad supported) hosting.PLUS you get:
Featured Template:
(Build your websites in minutes!) |