BuildTheDotCom | HTML Background Image

Site Pages

Tutorials

Other Stuff

Best Web Hosting
View our comprehensive reviews and ratings of the top 10 best web hosts.

Rapid Niche Websites
Build rapid niche websites with NIMS, the niche instant mashup site script.

You're Unique. So Are We.
Independent Webhosting Provider at your service. Two Servers with minimum accounts per server guarantee your site will have the operational response you deserve. Your site and your users will LOVE you for the change.

Best website hosting review
Best 10 Web Hosting Reviews by Top Webmasters. Get the most comprehensive reviews on the best web hosts by experienced Webmasters

O`Bannon's Leap
Informative blog that chronicles the ongoing leap of becoming a webpreneur.

See which Web Hosts BuildThe.com has reviewed and recommends >>

HTML Background Image

Setting a HTML background image on your web page is very easy. There are two ways to accomplish it. The first, with strictly HTML code will still work, however it should be mentioned that the second method, which utilizes CSS (cascading style sheet) is preferred and recommended to comply with web coding standards and newer browser software and devices.

HTML Background Image Code

In the "body" tag of your HTML page, you simply add the background property and provide the full path to your background image, like so:
<body background="full/path/to/Image.jpg">

That's it, you now have a background image on your web page.

CSS Background Image Code

Using CSS is preferred for many reasons. It will be more reliable across different browser types and devices, plus it allows you to have more control over your background image. For example, you can specify exactly where on the screen the image should disply, whether or not it should repeat. Maybe you'll want it to repeat horizontally but not vertically? You can do that with CSS.

Here's the basic code to add your background image from your CSS style sheet:

body {
background-image: url("/full/path/to/Image.jpg");
}

See our CSS Tutorials for more information on additional adjustments you can make to your HTML background image from within your CSS style sheet.