I have a weird, annoying problem. I have a css/
folder and index.html
at the root. I load css files in the header as follows:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>blabla</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="keywords" />
<meta name="description" content="desc" />
<!-- style files -->
<link rel="stylesheet" type="text/css" href="css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/layout.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/global.css" media="screen" />
</head>
but the css
is not working: I see a plain index.html
. I'm sure the css path is right; when I click "view source" and copy/paste the css files path, it shows the css files.
Also, when I copy the css directly into index.html
, it works. What could be the problem?
Probably not served as text/css. Did you check your server config?
The relative URL is likely wrong. To help you further we need to know two things:
Once you know both, you can do the math to get the right relative path for use in link
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With