In CSS, the URL syntax is used to specify background-image or other referenced files, such:
. Mainheader {
Height: 52px;
Background-image: URL (../images/mainheader_top_bj.gif );
Background-repeat: Repeat-X;
Background-position: top;
}
1. Type 1 of background-image:
In actual applications, CSS is often written into style files, and put into a special directory, put the image into a special image directory, and the actually used aspx file is in another directory, suppose there is a directory for practical application:
---- Root
---- Images
--Mainheader_top_bj.gif
---- CSS
--A1.css
---- Ff. aspx
Among them, ff.aspxis introduced to a1.css, and a1.css contains. mainheader, as shown inArticleUse the mainheader_top_bj.gif image in images.
The URL should be ff.aspx, or a1.css?
After testing, we found that the plugin is based on a1.css (that is, the CSS file), whether it is used in HTML files or on the Asp.net website.
2. behavior Class 1
behavior used by IE: URL (xxx/XXXXX. HTC) for HTML components. At this time, the HTC file path specified in the URL is relative to the directory where HTML is located, as shown below:
---- root
---- images
--mainheader_top_bj.gif
-- iepngfix. HTC
---- CSS
--a1.css
---- pub1
-- frm1.aspx
---- ff. aspx
If You Want To specify behavior in the a1.css file used by ff.aspx, you must:
behavior: URL (images/iepngfix. HTC)
of course, this usage is relatively rigid, so that this CSS file can only be used for aspx and HTML files under the root directory, if frm1.aspx in the pub1 directory wants to use this CSS, the above HTC directory is incorrect and should be changed to:
behavior: URL (.. /images/iepngfix. HTC)
Of course, it is better to specify the HTC in each aspx file instead of putting the HTC style into CSS; if you can set the relative path of the website's relative root (/), you can also write it (assuming iepngfix. HTC is fixed in the/images directory under the website root):
behavior: URL (/images/iepngfix. HTC)