|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
Join Date: Jun 2010
Posts: 199
|
Accessing CSS file
Hello folks....
I am trying to figure out how to use code to get the css file location but am having trouble...Let me explain.... here is your folders layout in your public folder images - dir css - dir html - dir I am trying to access a file (nyy.css) in the css dir. so the source code would be ./css/nyy.css if the html file was also in the root or public folder but its not.... Ok with me so far.... NOW....lets add another directory but lets call it baseball, within that folder will be another folder called teams then another folder inside that will be nyy..... images css html baseball -> sports -> nyy in the nyy folder I have a nyy.html folder. Here is my question from that html file what is the source code for accessing the css file the css folder in the public folder.. I know its something along the lines of this: ../../../css/nyy.css I can't seem to get the correct syntax.... Thank You in advance! Last edited by RobbieG1977; 09-27-2011 at 10:31 PM. |
|
|
|
|
|
#2 |
|
I don't computer.
Join Date: Mar 2003
Location: Ellisville, MO
Posts: 1,561
|
I'm trying to grasp what your question is...
Do you mean you are trying to link a specific document to the CSS stylesheet and you are not sure what the link to that file would be? For example, below is a sample file structure - _public_html __images __css ___styles.css __javascript __folder ___index.html ___subfolder ____index.html __index.html <- root document when loading domain So, if you were to link to the 'styles.css' stylesheet from the 'css' folder from the ROOT index.html document you code would be: HTML Code:
<link href="css/styles.css" rel="stylesheet" type="text/css">
HTML Code:
<link href="../css/styles.css" rel="stylesheet" type="text/css">
HTML Code:
<link href="../../css/styles.css" rel="stylesheet" type="text/css">
Last edited by mjkovis; 09-28-2011 at 09:44 AM. |
|
|
|
|
|
#3 |
|
Member (8 bit)
Join Date: Jun 2010
Posts: 199
|
Hey mjkovis,
That is exactly what I am looking for.... Root Folder -->css-->month.css -->images -->pages -->Yankees-->schedule-->month.htm -->index.htm That is how my root directory is currently setup. Now as you can see I want to take that month.htm and be able to access the month.css file way back in the root dire of the css folder. I know it is along the lines of the html code I have quoted by you. But I still can't figure out the exact line of code. HTML Code:
<link href="../../css/styles.css" rel="stylesheet" type="text/css">
|
|
|
|
|
|
#4 |
|
Forum Administrator
Staff
Premium Member
Join Date: May 2000
Location: Joplin MO
Posts: 37,790
|
Don't take this as gospel, but it looks to me that it would be:
../../css/month.css |
|
|
|
|
|
#5 | |
|
I don't computer.
Join Date: Mar 2003
Location: Ellisville, MO
Posts: 1,561
|
glc is correct below. If your month.htm file is two directories deep it would take two ../ to get back to the ROOT directory.
Quote:
HTML Code:
<link href="../../css/month.css" rel="stylesheet" type="text/css">
HTML Code:
<link href="http://www.example.com/css/month.css" rel="stylesheet" type="text/css">
|
|
|
|
|
|
|
#6 |
|
Member (2 bit)
Join Date: Sep 2011
Posts: 3
|
@mjkovis
your advices were very helpfull for me thank you very much |
|
|
|
|
|
#7 |
|
Member (8 bit)
Join Date: Jun 2010
Posts: 199
|
awesome..got everything in sync....
@Cartin - glad this thread was very helpful.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|