Jump to content

Accessing A parent directory.


Sniffy

Recommended Posts

I was wondering how I could access a file in a parent directory in an html anchor?Or for instance, say my stylesheet is in the parent directory and I'm in sub-directory "users", what code would I use to access it?

Link to comment
Share on other sites

put 2 periods in the href/src. for example, to get an image one directory up, use src="../image.jpg". you could also enter another directory, for example, src="../directory/image.jpg". To go two directories up, you use src="../../image.jpg", for three src="../../../image.jpg" and so on

Link to comment
Share on other sites

Suppose you were on domain www.something.com. Your current HTML page is www.something.com/hello/omg/what/hello.html.This stylesheet link would access www.something.com/hello/style.css<link ref="stylesheet" href="../style.css" />But if you wanted to access something.com/style.css, you'd use:<link ref="stylesheet" href="/style.css" />I think. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...