Dreamweaver不会读取第一组css代码

时间:2014-07-04 16:43:04

标签: html css dreamweaver

我的Dreamweaver和CSS有点困难......以下是代码:

<!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">
<head>
<link href="myCss.css" rel="stylesheet" type="text/css" />\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<p id="paragraph">welcome!</p>
<button id="button"> Click here </button>
</body>
</html>

这是我的css代码

@charset "utf-8";
<style type="text/css">
#button{
font-style:italic;
font-color:red;}    
#paragraph{
font-style:italic;}
</style>

我的问题是为什么#paragraph工作且#button无法正常工作?

1 个答案:

答案 0 :(得分:0)

在样式标记之前删除该charset声明,同时将font-color更改为color

http://jsfiddle.net/63GRZ/

<p id="paragraph">welcome!</p>
<button id="button"> Click here </button>

 Here is my css codes

<style type="text/css">
#button{
font-style:italic;
color:red;}    
#paragraph{
font-style:italic;}
</style>