html中scoped意思是什么代表什么

html中scoped意思是什么代表什么,第1张

scoped 属性是一个布尔属性。

如果使用该属性,则样式仅仅应用到 style 元素的父元素及其子元素。

实例

使用 scope 属性描述 <div>元素的样式:

<div>

    <style type="text/css" scoped>

        h1 {color:red}

        p {color:blue}

    </style>

    <h1>这个标题是红色的</h1>

    <p>这个段落是蓝色的。</p>

</div>

scope 属性 -- 行或列的表头属性 scope -- 通过此属性可以定义行或列的表头取值 col -- 定义列表头row -- 定义行表头colgroup -- 定义列组的表头信息,是column group的缩写rowgroup -- 定义行组的表头信息,是row group的缩写scope属性通常可以连接表格数据单元格和表头.

scope

属性

--

定义了行或列的表头

scope

--

通过此属性可以定义行或列的表头

取值

col

--

定义列表头

row

--

定义行表头

colgroup

--

定义列组的表头信息,是column

group的缩写

rowgroup

--

定义行组的表头信息,是row

group的缩写

引用网址:

http://www.dreamdu.com/xhtml/attribute_scope/

示例

<table

width=“80%“>

<tr>

<th>

</th>

<th

abbr=“com

domain“=

scope=“col“>.com域名的数量</th>

<th

abbr=“cn

domain“=

scope=“col“>.cn域名的数量</th>

<th

abbr=“net

domain“=

scope=“col“>.net域名的数量</th>

</tr>

<tr>

<th

abbr=“2003s“

scope=“row“>2003</th>

<td>1000</td>

<td>2000</td>

<td>3000</td>

</tr>

<tr>

<th

abbr=“2004s“

scope=“row“>2004</th>

<td>4000</td>

<td>5000</td>

<td>6000</td>

</tr>

<tr>

<th

abbr=“2005s“

scope=“row“>2005</th>

<td>7000</td>

<td>8000</td>

<td>9000</td>

</tr>

</table>

说明

scope属性通常可以连接表格数据单元格和表头.

另一种连接表格数据单元格和表头的方法是使用headers属性,此属性通常只使用在表格比较复杂的情况下.


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7226025.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-03
下一篇 2023-04-03

发表评论

登录后才能评论

评论列表(0条)

保存