The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Redirect to root folder from child folder
sleighr
post Nov 13 2012, 12:35 AM
Post #1





Group: Members
Posts: 8
Joined: 4-October 12
Member No.: 17,892



Okay, now that I've gotten my dropdown menus figured out, I have another question that hopefully will have an easier fix. I want to use child directories for organization purposes of my .html files, but in the headers of all of my .html files, they direct to css and javascript files in css and js folders that are located in the parent directory. So I don't exactly know how to write out the filepaths when the html file is in a child directory, not a parent directory. EX:

Parent/
index.html
/css
/js
/child

/Child
blah.html

When looking at the stuff in the header, I see:

CODE
<head>
    <title>Home</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" media="screen" href="css/reset.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/grid_12.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/slider.css">
<link rel="stylesheet" media="all" type="text/css" href="css/hover_drop_2.css" />
<script src="css/iefix.js" type="text/javascript"></script>
    <script src="js/jquery-1.7.min.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/tms-0.4.1.js"></script>
    <script src="js/cufon-yui.js"></script>
    <script src="js/cufon-replace.js"></script>
    <script src="js/Kozuka_L_300.font.js"></script>
    <script src="js/Kozuka_B_700.font.js"></script>
    <script>
        $(document).ready(function(){                       
            $('.slider')._TMS({
                show:0,
                pauseOnHover:true,
                prevBu:'.prev',
                nextBu:'.next',
                playBu:false,
                duration:10000,
                <!--preset:'zoomer', -->
                pagination:true,
                pagNums:false,
                slideshow:7000,
                numStatus:false,
                banners:'fade',
                waitBannerAnimation:false,
                progressBar:false
            })        
        });
    </script>
    <!--[if lt IE 8]>
       <div style=' clear: both; text-align:center; position: relative;'>
         <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
           <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You

are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
        </a>
      </div>
    <![endif]-->
    <!--[if lt IE 9]>
           <script type="text/javascript" src="js/html5.js"></script>
        <link rel="stylesheet" type="text/css" media="screen" href="css/ie.css">
    <![endif]-->

</head>
<body onload="ieFix('menu')">
  <!--==============================header=================================-->
    <header>
        <div class="main">
            <h1><a href="index.html"><img src="images/logo.png" alt=""></a></h1>
            </div>
            <div class="clear"></div>
        </div>
    </header>  


As you can see, the src seems to only go from the current directory and forward, but I need it to backtrack so that headers in the html files of the child folders can still access the information in the css and js files in the parent directory :/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 13 2012, 07:05 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



To go one directory up you type
CODE
../

two directories up
CODE
../../

and so on.

Or you can use root relative URLs, beginning with a slash. They will be good from any directory so you don't have to use different ones depending on where the HTML is.
CODE
/css/reset.css


For the full monty see http://htmlhelp.com/faq/html/basics.html#relative-url .

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
sleighr
post Nov 13 2012, 05:48 PM
Post #3





Group: Members
Posts: 8
Joined: 4-October 12
Member No.: 17,892



Thank you so much! You're a life saver (:
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 06:12 PM