日期:2014-05-17  浏览次数:20534 次

为什么在里面那一层显示不了蓝色的背景
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Com" />

<title>无标题 1</title>
</head>
<style>
body{
    background-color:red;
}
.content{
    padding:40px;
    float:left;
    background-color:blue;
}
</style>
<body>

<div id="content">
<a>没有蓝色</a>
</div>

</body>
</html>
html div

------解决方案--------------------
亲你定义.content,你调用的时候居然用#content
------解决方案--------------------
引用:
亲你定义.content,你调用的时候居然用#content

<div id="content">
<a>没有蓝色</a>
</div>
---------------------
<div class="content">
<a>没有蓝色</a>
</div>
------解决方案--------------------
选择器写错了,要用
.content a(注意这里){