CSS: background-images base -
Is it possible to enter the original tag / annotation in CSS, something that is in HTML? I need one because I use mod_rewrite and the URL looks like this: domain.com/path/to/something/
So my background images are not correct (just index / home page) ). I can think of adding the whole domain (which I have to change every time I update CSS on my webspace), but I do not like to do this.
Make a structure something similar:
/index.html / Img /image1.png /image2.png / css / styles CSS
Move all your CSS rules to the external styles.css stylesheet.
Now, within the CSS, your image is relative to the reference space the stylesheet - so that you have a related code like Using Relative URL within your CSS means that you are free to move your stylesheet and background images to different folders - or even somebody To a different domain or server - When the full url background-image: url (../ img / image1 .png); Finally, make sure that in your HTML code, you use a full URL to link your stylesheet - like:
& Lt; Link type = "text / css" rel = "stylesheet" href = "/ css / styles css" />
/ css / styles.css
will not be affected by mod_rewrite in your HTML link tag or some other reason that affects the clear location of your page on your server.
Comments
Post a Comment