Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Folders in a Website

Featured Replies

I was wondering if it's possible to access files from the root folder of a website whilst in a different folder. For example, in my current website which I'm building, I want to have a 'blog' folder with sub-folders. However, I want to be able to include the 'main.css' file and the 'imgs' folder which are in the website root. Is this possible?

 

And, if so, can I then add more sub-folders so that the website looks like this:

root / blog / May
		/ June
		/ July

etc...

 

Sorry if I explained it badly! :)

If your folder structure was like this:

root / blog / May

and you had a css file called my.css in root, for May to access the css file you would use

<link rel="stylesheet" type="text/css" href="../../my.css" />

  • Author
If your folder structure was like this:

root / blog / May

and you had a css file called my.css in root, for May to access the css file you would use

<link rel="stylesheet" type="text/css" href="../../my.css" />

Ah, okay. So what about accessing the 'imgs' folder?

 

Would this work:

<img src="../../imgs/image-example.jpg">

Ah, okay. So what about accessing the 'imgs' folder?

 

Would this work:

<img src="../../imgs/image-example.jpg">

Yes. :) As long as that is the correct relative path from the document.

  • Author
Yes. :) As long as that is the correct relative path from the document.

Awesome, thanks for the help!

If you have your headers in an include.php and you don't wanna create diffrent includes for every folder level you can also just use the entire url.

<img src="http://www.yourdomain.com/images/yourimage.jpg">

 

This way it doesn't matter if you move pages or create another subdirectory.

Or you could just use

 

<img src="/imgs/image-example.jpg">

or

<link rel="stylesheet" type="text/css" href="/my.css" />

 

and never need to worry about../../../ again :)

may be using the full web address for the file? as long as it is web accessiable?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.