样式未出现在Firefox和Chrome中 [英] Style does not appear in Firefox and Chrome
本文介绍了样式未出现在Firefox和Chrome中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的html页面.当我使用Internet Explorer 8查看此页面时,它也会显示样式.但是,当我使用Google Chrome或Firefox查看它时,没有显示样式.你能帮我为什么吗?我做错了什么?
HTML文件:
Hi,
I have a simple html page. When I view this page using Internet Explorer 8, it shows also style. But when I view it using Google Chrome or Firefox, style does not appear. Can you help me why ? What am I doing wrong ?
HTML File:
<html>
<head>
HEAD SECTION
<!--<link type="text/css" href="txt.css" rel="stylesheet"/>-->
<style type="text/css">
@import url("txt.css");
</style>
</head>
<body>
<div class="clsverdana">Html new starts here...</div>
<div id ="divId">Html new ends here...</div>
</body>
</html>
CSS文件:
CSS File:
.clsverdana
{
font-family = verdana;
font-size = 16;
font-weight = bold;
color = orange;
}
#divId
{
font-family=Tahoma;
font-size= 16;
font-weight = bold;
color = purple;
}
body
{
background-color=blue;
}
推荐答案
不要使用样式标签,而FireFox不支持的"@import"在<<内使用; head>>标签:
Don''t use the style tag and "@import" it isn''t supported in FireFox use this inside the <<head>> tag:
<head>
...
<link rel="stylesheet" media="screen" href="corporate-screen.css" type="text/css"/>
...
</head>
.clsverdana
{
font-family: verdana;
font-size: 16px;
font-weight: bold;
color: orange;
}
#divId
{
font-family: Tahoma;
font-size: 16px;
font-weight: bold;
color: purple;
}
body
{
background-color: blue;
}
有关在HTML中插入外部样式表的完整参考,请访问此处:
http://www.w3.org/TR/html4/present/styles.html# h-14.3 [^ ]
最好的问候,
曼弗雷德(Manfred)
For a complete reference on inserting external stylesheets in HTML please visit here:
http://www.w3.org/TR/html4/present/styles.html#h-14.3[^]
Best Regards,
Manfred
这篇关于样式未出现在Firefox和Chrome中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文