- 论坛徽章:
- 49
|
介绍
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 |
|