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 w开发者_StackOverflow中文版ith directory /style/ with file main.css.
Can you help me? I am idiot?
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>
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.
精彩评论