In the CSS file, sometimes will use background, namely to add a background image, generally when do the button style is often used.

I add CSS background images and CSS files according to the pictures the relative position of points several types:
1. With the package under: background: url (aaa. GIF); Different package:
2.
in this case there are 2 ways to setup, one kind is to use absolute paths, namely http://www.iteye.com/aaa.gif, but is generally not recommended use it, is not conducive to project transplant; One is to use a relative path, you will first need to find images and CSS files together a root directory, then add subdirectories of images, such as: location:
CSS file/WebRoot/test/CSS a.c ss
image file location: WebRoot/platform/resource/images/ICONS/al-qeada if
you want to find a common root directory is required " ../" The meaning of this path is a directory at the next higher level, if is two layers of upper directory, is " ../../" Then, according to the written word, a.c in ss have CSS background image should write:

  code is as follows:  


background: url (../../platform/resource/images/ICONS/al-qeada if)

why?

first of all, we observed the positions of the two files, can be found that the common root directory WebRoot,
we first place in the a.c ss find WebRoot, so have " ../../" Then stitching images subdirectory paths have " Atul gawande at the platform/resource/images/ICONS/if" Together after is the result of the above.


This concludes the body part