当前位置: 代码迷 >> HTML/CSS >> 请问个css的有关问题,为什么p元素不受css影响哦
  详细解决方案

请问个css的有关问题,为什么p元素不受css影响哦

热度:2718   发布时间:2013-02-26 00:00:00.0
请教个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;}
  相关解决方案