单项选择题

在HTML中,使用HTML元素的class属性,将样式应用于网页上某个段落的代码如下所示:< P class=“firstp”>这是一个段落< /P> 下面选项中,()正确定义了上面代码引用的样式规则。

A、<style type="text/css">P{color:red}</style> 
B、<style type="text/css">#firstp {color:red} </style> 
C、<style type="text/css"> .firstp{color:red} </style> 
D、<style type="text/css">P.firstp{color:red}</style>

微信扫码免费搜题