tucnak
tucnak

Reputation: 33

I can't load my CSS-file?

I am PHP programmer now. And I am writing new project. When I want to load file using:

<!DOCTYPE html>
<html>
<head>
<base href="http://quest.my/" />
<title>Quest The Game</title>
<link rel="stylesheet" type="text/css" href="style/main.css"  /> 
<script type="text/javascript" src="src/js/jquery.js"></script>
</head>

But it is not working! It have to wark. I have my own virtal-host quest.my with directory /style/ with file main.css.

Can you help me? I am idiot?

Upvotes: 0

Views: 2274

Answers (2)

Ameer
Ameer

Reputation: 771

try like this:

<!DOCTYPE html>
<html>
<head>
<title>Quest The Game</title>
<link rel="stylesheet" type="text/css" href="http://quest.my/style/main.css"  /> 
<script type="text/javascript" src="http://quest.my/js/jquery.js"></script>
</head>

Upvotes: 1

jmar777
jmar777

Reputation: 39689

You need to use /style/main.css (note the leading /). That will cause the path to be relative to the root of the document (which will then refer to your <base/> tag). Right now it's a relative path, and therefore relative to the location the page was served from.

Upvotes: 1

Related Questions