• 2022-05-26
    {下面代码使用HTML元素的ID属性,将样式应用于网页上的某个段落:<P id="firstp">这是第一个段落</P>下面选项中,()正确定义了上面代码引用的样式规则。}
    A: {<style type="text/css">p {color:red}</style>}
    B: {<style type="text/css">
    C: firstp {color:red}</style>}
    D: {<style type="text/css">.firstp {color:red}</style>}
    E: {<style type="text/css">p.firstp {color:red}</style>}
  • B

    举一反三

    内容

    • 0

      在HTML文件中应用abc.css文件中的样式的方法有( ) A: &lt;link href="abc.css" type="text/css" rel="stylesheet"&gt; B: &lt;style type="text/css"&gt;@import (abc.css);&lt;/style&gt; C: &lt;style type="text/css"&gt;import url (abc.css);&lt;/style&gt; D: &lt;style type="text/css"&gt;@import url(abc.css);&lt;/style&gt;

    • 1

      下面代码使用HTML元素的id属性,将样式应用于网页上的某个段落:<p id="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>

    • 2

      关于行内式引入CSS样式表,以下书写正确的是( ) A: &lt;p style=font-size:12px; color:red;&gt;段落文本&lt;/p&gt; B: &lt;p style="font-size:12px, color:red;"&gt;段落文本&lt;/p&gt; C: &lt;p style="font-size:12px; color:red;"&gt;段落文本&lt;/p&gt; D: &lt;p style="font:12px; color:red;"&gt;段落文本&lt;/p&gt;

    • 3

      CSS样式代码如下所示,则选项( )能够实现在页面中将“文本”两个字显示为红色&lt;style type="text/css"&gt; #h1 { color:red; } .title { color:red; }&lt;/style&gt;。 A: &lt;p class="title"&gt;文本&lt;/p&gt; B: &lt;h1&gt;文本&lt;/h1&gt; C: &lt;h1 id="title"&gt;文本&lt;/h1&gt; D: &lt;p name="h1"&gt;文本&lt;/p&gt;

    • 4

      在HTML中,使用HTML元素的class属性,将样式应用于网页上某个段落的代码如下所示:<Pclass=“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"> E: firstp{color:red}</style>