免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1560 | 回复: 0
打印 上一主题 下一主题

[HTML/HTML5] 千呼万唤 HTML 5 (5) - 元素的通用属性 [复制链接]

论坛徽章:
49
15-16赛季CBA联赛之福建
日期:2016-06-22 16:22:002015年亚洲杯之中国
日期:2015-01-23 16:25:12丑牛
日期:2015-01-20 09:39:23未羊
日期:2015-01-14 23:55:57巳蛇
日期:2015-01-06 18:21:36双鱼座
日期:2015-01-02 22:04:33午马
日期:2014-11-25 09:58:35辰龙
日期:2014-11-18 10:40:07寅虎
日期:2014-11-13 22:47:15申猴
日期:2014-10-22 15:29:50摩羯座
日期:2014-08-27 10:49:43辰龙
日期:2014-08-21 10:47:58
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-08-20 09:27 |只看该作者 |倒序浏览
介绍
HTML 5: 元素的通用属性

  • 元素的通用属性 - accesskey, style, class, title, tabindex, id, dir, spellcheck, hidden, contenteditable, contextmenu, draggable, dropzone

    示例
    1、accesskey - 用于定义快捷键
    element/_globalAttributes/accesskey.html



        accesskey


       
       
       
        webabcd blog
       
        webabcd blog
       

    2、style - 用于定义样式
    element/_globalAttributes/style.html



        style


       
       
       
        webabcd
       

    3、class - 指定需要应用的 css 类选择器
    element/_globalAttributes/class.html



        class
       
         
            .myClass { font-size:36px; }
            .myClass2 { color:Blue; }
         
      


       
         
       
        webabcd
       

    4、title - 用于描述元素信息,相当于 ToolTip
    element/_globalAttributes/title.html



        title


       
       
       
        webabcd blog
       
         
       

    5、tabindex - 用于定义 TAB 键的导航顺序(整型值)
    element/_globalAttributes/tabindex.html



        tabindex


       
         
       
         
          
         
       
         
       
         
       
         
       
         
       
         
       

    6、id - 用于定义元素的唯一标识,主要给 DOM 用
    element/_globalAttributes/id.html



        id


       
         
       
        webabcd blog
       
         
            alert(document.getElementById('myId').innerHTML);
         
       

    7、dir - 文本排列方向,可能的值有:auto|ltr|rtl(dir 是 direction 的缩写)
    element/_globalAttributes/dir.html



        dir


       
       
        123
       

    8、spellcheck - 是否使用浏览器的拼写检查功能对元素内的内容做拼写检查
    element/_globalAttributes/spellcheck.html



        spellcheck


       
       
       
         
    i am jack, i am webabcd, haha, good, hehe
         
       

    9、hidden - 用于隐藏元素(不占位)
    element/_globalAttributes/hidden.html

    本文来自ChinaUnix文档频道,如果查看原文请点:http://doc.chinaunix.net/web/201208/2325453.shtml
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP