I have a general question (I'm not all to familiar with html).
The following use of the slash I have discovered points to a sub-directory, in this case for Images:
/Image/my_Image.png
Is there an html equivalent for pointing to a parent directory?
Starting with / returns to the root directory and starts there. Starting with ../ moves one directory backward and starts there. Starting with ../../ moves two directories backward and starts there (and so on...) To move forward, just start with the first sub directory and keep moving forward.
.. (double-dot) is the parent of your current directory. ~ (tilde) is your home directory. / (slash) if it present at first character, it usually is called root directory.
../
will give you one level higher parent directory. You can use as much as you want to go higher level parents like ../../
../Image/my_Image.png
will be Image folder in parent directory
Single dot = current directory, double dot is parent directory...
./ = current ../ = parent
So let's say you have a style rule for an image in a CSS file called "styles.css".
When the CSS is being read, it will be the location of that css file that's used for the current location. So if you want to get to your image, you can point it like this:
background: url("../Image/my_Image.png") no-repeat scroll 0 0 transparent;
If the location of the image would have been directly on C:\, you would have to go back two parent directories:
background: url("../../my_Image.png") no-repeat scroll 0 0 transparent;
This principle also goes for JavaScript files and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With