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

请教个css的问题,为什么p元素不受css影响哦?
大家看下下面的html,发现p元素中的数据不受css影响,为什么呀?

<html>
<head>
<style type="text/css">
h1 {font-family:Georgia;}
</style>
</head>

<body>
<h1>This is heading 1</h1>

<p>This is a paragraph.</p>

<p>This is a paragraph.</p>

<p>...</p>
</body>
</html>

------解决方案--------------------
你只是给h1标签加样式,没有给P标签加样式,当然没有影响,改成下面试下。

h1 ,p{font-family:Georgia;}