Jump to content

error when linking


svendsek

Recommended Posts

Hi! I have a bit of an annoying hassle with linking to my CSS, and i really don't quite know how to explain the problem, but I'll do my very best:

 

So, i have this css that i use in my site, that has been working perfectly for the last few months, up until now. I've started developing the admin-area of my site, I've placed the portion that I'm having trouble with in a folder called "innlegg" or "posts" in english. (the folder is located one level above root) The top part of my page is the same in every page (header, navbar and so on) So I have put all theese bits of code in a file that i include in the top of the document. the include file contains the linking to the css, wich looks like this:

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

I use dreamveawer cs4 for developing, and in design view, the code above, is the only thing that seems to be giving any results. now, I know that you can't trust DW's design view, and that using DW in itself probably is a sin, according to the codecs of theee forums,  :D but anyhow, when I open the page that I've been working on (only the posts part) displays without any CSS applied to it...

 

What do you guys think is the problem?

is there an error in the linking to the css, or is it because of the including

 

any answer would be widely apriciated.

 

Excuse my faulty English, I am but a meere Norwegian :D 

 

Link to comment
Share on other sites

I am no expert but maybe the file cannot be found because in the snippet you say<link href="css/stil2.css" rel="stylesheet" type="text/css" />,and you say you have moved that file to a folder called "innlegg:" So try adding <link href="innlegg/css/stil2.css" rel="stylesheet" type="text/css" />

Link to comment
Share on other sites

Restart your computer/dreamweaver. i think the stylesheet was in dreamweavers cache/memory (incorrectly).

 

I recommend getting firebug for firefox. Its a simple plug-in which will lets you keep track of css styles within each element. You could also see which stylesheets are connected to the html page.

Link to comment
Share on other sites

Thank you very much for the tips :) as i continue developing, an other question rose in my mind:

when you link to a file situatet one level higher than the file you are working in, you do this with ../filename.php or is that wrong?  :P

 

 

I know the question is kinda off topic, but i thought it would be okay for just a small follow-up question :) in the future i will start new topics in the right forums :P

Link to comment
Share on other sites

Yes for one level up use ../, nothing wrong with it.

you can use / at the start to begin at the root as well. (although for local testing this is usually a pain as whatever you're working on will be in a subdirectory instead of the root.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.