HTML5--》details

<details>是HTML5的新标签,用于描述文档或文档某个部分的细节。

目前只有 Chrome 和 Safari 6 支持 <details> 标签。

与 <summary> 配合使用可以为 details 定义标题。标题是可见的,用户点击标题时,会显示出 details。

值:

open:值为open,功能是定义details是否可见

 1 <!doctype html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8">
 5 <title>交互元素details元素的使用</title>
 6 <style type="text/css" >
 7 body{font-size:12px;}
 8 span{font-weight:bold;}
 9 details{
10     overflow:hidden;
11     height:0;
12     padding-left:200px;
13     position:relative;
14     display:block;
15     }
16 details[open]{height:auto;}
17 </style>
18 </head>
19 
20 <body>
21 <span>隐藏</span>
22 <details>
23 <summary>我的网站</summary>
24 www.calamus.cn
25 </details>
26 <span>显示</span>
27 <details open="open">
28 <summary>我的网站</summary>
29 www.calamus.cn
30 </details>
31 </body>
32 </html>

          chrome下的效果图

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值