PDA

View Full Version : External CSS not linking with xhtml...



joannapo
10-03-2009, 10:03 AM
Hi,

I've got a template that I like and would like to play around with, the only problem is that when I publish it (with Filezilla) it doesn't read the the css file that it should. My domain is joannaporter.com, and the tag I have in the XHTML file is:

<html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>home</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"><link rel="stylesheet"
href="css/1.css" type="text/css"
media="screen,projection"></head>

the css file has been published as 1.css in my public_html directory, but it's not picking it up.

Can anyone help at all?
Thanks

farcaster
10-03-2009, 12:13 PM
Your problem is as follows:

This is what you are showing in your html file (note the bold text):


<link rel="stylesheet" href="css/1.css" type="text/css" media="screen,projection">

Yet later you state:


has been published as 1.css in my public_html directory

You can fix your problem by creating a folder in the public_html directory and moving 1.css into that (the preferred method, keeping css files in a css folder).

Or the quick and dirty fix is to change the code to say href="1.css" and eliminate the path.

joannapo
10-05-2009, 05:19 AM
Your problem is as follows:

This is what you are showing in your html file (note the bold text):



Yet later you state:



You can fix your problem by creating a folder in the public_html directory and moving 1.css into that (the preferred method, keeping css files in a css folder).

Or the quick and dirty fix is to change the code to say href="1.css" and eliminate the path.

Thanks for that, I feel a tad silly now, as soon as I read your response it seemed really obvious. D'oh! :o

Anyway, I decided to keep to the CSS script in a seperate file, as suggested. It seems like the best idea for good housekeeping...

Thanks!