简体   繁体   English

内联CSS样式工作,但外部CSS样式不

[英]Inline CSS Styles Work, but External CSS Styles Don't

I need help. 我需要帮助。 This is ridiculous. 这是荒唐的。

I'm using Komodo IDE, version 7.1.2, and Firefox version 15.0.1. 我正在使用Komodo IDE,版本7.1.2和Firefox版本15.0.1。

I created an HTML5 file like so: 我创建了一个HTML5文件,如下所示:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta charset="utf-8" />

<title>Web Page</title>

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

</head>

<body>

<div id="release">Release Date</div>

</body>

</html>

And the global stylesheet contains this and is located in a directory at the same level as the HTML file called css : 全局样式表包含它,并且位于与名为css的HTML文件相同级别的目录中:

#release {
    text-align: center;
    font: small-caps;
    border-top: solid 1px;
    border-bottom: solid 1px;
    border-right: solid 10px;
}

Here is a picture of the directory structure: 这是目录结构的图片:

在此输入图像描述

I put the same styling into he HTML file and it works, but the styling isn't working with the external stylesheet. 我将相同的样式放入HTML文件中并且它可以工作,但样式不适用于外部样式表。 I am not new to website development, so this is particularly puzzling to me. 我对网站开发并不陌生,所以这对我来说尤其令人费解。

I tried this same thing on two Windows 7 machines and one Ubuntu 11.10 machine as well, with the same anomaly. 我在两台Windows 7机器和一台Ubuntu 11.10机器上尝试了同样的事情,但是同样的异常。

Here is the fiddle working: 这是小提琴工作:

http://jsfiddle.net/NKq8N/1/ http://jsfiddle.net/NKq8N/1/

What could be causing this? 可能是什么导致了这个?

<link>属性中, type应为“text / css”,而不是“css / text”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM