2

My file structure is as follows....

iamdan > css > style.css

My php file, head.php is in a file called includes which is in:

iamdan > includes > head.php

which contains the following code:

<head>
<title>Website title!!!</title>
<meta charset="UTF"-8">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>

Now it's loading the info fine and some of the style sheet (just the font style) none of the other styling is coming through...

Any ideas?

4

1 回答 1

2

You have a mistake in your meta charset:

<meta charset="UTF-8">

And the other thing is:

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

This is relative from your script position. When you are in a subfolder. The path is wrong.

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

Put a / before your path. Then your browser load the css file always from the root:

xx.de/css/style.css

Or put the complete URL before your script.

<link rel="stylesheet" href="http://xx.xx.de/css/style.css" type="text/css">
于 2013-03-30T10:41:40.813 回答