search
HomeWeb Front-endH5 TutorialXiaoqiang's road to HTML5 mobile development (13) - Global attributes in HTML5

1. accssskey shortcut key

<!DOCTYPE HTML>  
<html>  
<body>  
  
<a href="http://blog.csdn.net/column/details/dawanganban-html5.html" accesskey="w">小强的HTML5移动开发之路</a><br />  
<a href="http://blog.csdn.net/column/details/android-growup.html" accesskey="g">Android菜鸟的成长笔记</a>  
  
<p><b>注释:</b>请使用 Alt + <i>accessKey</i> 来访问带有快捷键的元素。</p>  
  
</body>  
</html>

Xiaoqiangs road to HTML5 mobile development (13) - Global attributes in HTML5

Interested friends can hold down Alt + g and Alt + w to try it

Xiaoqiang’s HTML5 mobile Development Road
Android Novice’s Growth Notes

Note: Please use Alt + accessKey to access elements with shortcut keys.

This tag has no difference between HTML4 and HTML5.

2. The class attribute specifies the element class name

<!DOCTYPE HTML>  
<html>  
<head>  
<style type="text/css">  
h1.intro {color:blue;}  
p.important {color:green;}  
</style>  
</head>  
<body>  
  
<h1 id="Header-nbsp">Header 1</h1>  
<p>A paragraph.</p>  
<p class="important">请注意这个重要的段落。:)</p>  
  
</body>  
</html>

Xiaoqiangs road to HTML5 mobile development (13) - Global attributes in HTML5

3. The contenteditable attribute specifies whether the content of the element can be edited

<!DOCTYPE HTML>  
<html>  
<body>  
  
<p contenteditable="true">这是一段可编辑的段落。请试着编辑该文本。</p>  
  
</body>  
</html>

This is an editable paragraph. Please try editing the text.

The contenteditable attribute is a new attribute in Html5

4. The contextmenu attribute specifies the context menu for the element. This menu will appear when the user right-clicks on the element

Currently no major browser supports the contextmenu attribute.

<!DOCTYPE html>  
<html>  
<body>  
  
<p contextmenu="supermenu">本段落拥有一个名为 "supermenu" 的上下文菜单。这个菜单会在用户右键单击该段落时出现。</p>    
  
<menu id="supermenu">  
  <command label="Step 1: Write Tutorial" onclick="doSomething()">  
  <command label="Step 2: Edit Tutorial" onclick="doSomethingElse()">  
</menu>  
  
<p><b>注释:</b>目前的主流浏览器都不支持 contextmenu 属性。</p>  
  
</body>  
</html

5. The dir attribute specifies the text direction of the element content.

<p dir="rtl">Write this text right-to-left!</p>

Value Description

ltr Text direction from left to right.

rtl Text direction from right to left.

auto Let the browser determine the text direction based on the content. Recommended only when text orientation is unknown.

6. The draggable attribute specifies whether the element can be dragged.

Value Description

#true Specifies that the element is draggable.

false Specifies that the element is not draggable.

auto Use the browser's default features.

Currently only Firefox, Chrome and Safari support the draggable attribute.

7. The dropzone attribute specifies whether the dragged data will be copied, moved or linked when it is dragged and dropped on the element.

Currently no major browser supports the dropzone attribute.

8. The hidden attribute specifies that the element is hidden.

The hidden attribute is a new attribute in HTML5.

9. The id attribute specifies the unique id of the HTML element

<html>  
<head>  
<script type="text/javascript">  
function change_header()  
{  
document.getElementById("myHeader").innerHTML="Nice day!";  
}  
</script>  
</head>  
  
<body>  
<h1 id="Hello-nbsp-World">Hello World!</h1>  
<button onclick="change_header()">改变文本</button>  
</body>  
  
</html>

10. The lang attribute specifies the language of the element content.


ISO 639-1 defines abbreviations for various languages. You can use them in the lang and xml:lang attributes in HTML and XHTML.

Language

ISO Code

Abkhazian ab

Afar aa

Afrikaans af

Albanian sq

Amharic am

Arabic ar

Armenian hy

Assamese as

Aymara ay

Azerbaijani az

Bashkir ba

Basque eu

Bengali (Bangla) bn

Bhutani dz

Bihari bh

Bislama bi bi

Breton br

Bulgarian bg

Burmese my

Byelorussian (Belarusian) be

Cambodian km

Catalan ca

Cherokee

Chewa

Chinese (Simplified) zh

Chinese (Traditional) zh

Corsican co  

Croatian   hr  

Czech   cs  

Danish   da  

Divehi    

Dutch     nl  

Edo  

English en

Esperanto eo

Estonian et

Faeroese fo

Farsi fa

Fiji fj

Finnish fi  

Flemish  

French   fr  

Frisian   fy  

Fulfulde  

Galician   gl  

Gaelic (Scottish) gd

Gaelic (Manx) gv

Georgian ka

German de

Greek el

Greenlandic kl

Guarani gn  

Gujarati gu  

Hausa   ha  

Hawaiian  

Hebrew   he, iw  

Hindi   hi  

Hungarian hu

Ibibio

Icelandic is

Igbo

Indonesian id, in

Interlingua ia

Interlingual ie

Inuktitut iu

I speak

Irish ga

Italian it

Japanese and

Javanese jv

Kannada kn

Kanuri

Kashmiri ks

Kazakh kk

Kinyarwanda (Rwanda) rw

Kirghiz ky

Kirundi (Rundi) rn

Konkani

Korean is

Kurdish is

Laothian is not

Latin la

Latvian (Lettish) lv

Limburgish ( Limburger) li

Lingala ln

Lithuanian lt

Macedonian mk

Malagasy mg

Malay ms

Malayalam ml

Maltese mt

Maori mi

Marathi mr

Moldavian mo

Mongolian mn

Nauru and

Nepali and

Norwegian no

Occitan oc

Oriya or

Oromo (Afan, Galla) om

Papiamentu

Pashto (Pushto) ps

Polish pl

Portuguese pt

Punjabi pa

Quechua qu

Rhaeto-Romance rm

Romanian ro

Russian ro

Sami (Lappish)

Samoan sm

Sangro sg

Sanskrit sa

Serbian sr

Serbo-Croatian sh

English st

English tn

Shona sn

Sindhi sd

Sinhalese si

Siswati ss

Slovak sk

Slovenian sl

Somali so

Spanish is

Sundanese so

Swahili (Kiswahili) sw

Swedish sv

Syriac

Tagalog tl

Tajik tg

Tamazight

Tamil ta

Tatar tt

Telugu te

Thai th

Tibetan bo

Tigrinya te

Tonga to

Tsonga ts

Turkish tr

Turkmen tk

Twi tw

Uighur ug

Ukrainian uk

Urdu ur

Uzbek uz

Venda

Vietnamese vi

Volapuk vo

Welsh cy

Wolof wo

Xhosa xh

Yi

Yiddish yi, ji

Yoruba yo

Zulu zu

In spellcheck your dictionary is based Other configuration settings:


#######################################中Page(s)############################textarea ############spellcheck free HTML5 free download###

十二、style 属性规定元素的行内样式(inline style)HTML4和HTML5无差异
十三、tabindex 属性规定当使用 "tab" 键进行导航时元素的顺序。

<!DOCTYPE HTML>  
<html>  
<body>  
  
<a href="http://www.w3school.com.cn/" tabindex="2">W3School</a><br />  
<a href="http://www.google.com/" tabindex="1">Google</a><br />  
<a href="http://www.microsoft.com/" tabindex="3">Microsoft</a>  
  
</body>  
</html>

十四、title   属性规定关于元素的额外信息

<!DOCTYPE HTML>  
<html>  
<body>  
  
<p><abbr title="世界卫生组织">WHO</abbr> 成立于 1948。</p>  
<p title="免费的 Web 教程">W3School.com.cn</pl>  
  
</body>  
</html>

Xiaoqiangs road to HTML5 mobile development (13) - Global attributes in HTML5

以上就是 小强的HTML5移动开发之路(13)——HTML5中的全局属性的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
html5的div一行可以放两个吗html5的div一行可以放两个吗Apr 25, 2022 pm 05:32 PM

html5的div元素默认一行不可以放两个。div是一个块级元素,一个元素会独占一行,两个div默认无法在同一行显示;但可以通过给div元素添加“display:inline;”样式,将其转为行内元素,就可以实现多个div在同一行显示了。

html5中列表和表格的区别是什么html5中列表和表格的区别是什么Apr 28, 2022 pm 01:58 PM

html5中列表和表格的区别:1、表格主要是用于显示数据的,而列表主要是用于给数据进行布局;2、表格是使用table标签配合tr、td、th等标签进行定义的,列表是利用li标签配合ol、ul等标签进行定义的。

html5怎么让头和尾固定不动html5怎么让头和尾固定不动Apr 25, 2022 pm 02:30 PM

固定方法:1、使用header标签定义文档头部内容,并添加“position:fixed;top:0;”样式让其固定不动;2、使用footer标签定义尾部内容,并添加“position: fixed;bottom: 0;”样式让其固定不动。

HTML5中画布标签是什么HTML5中画布标签是什么May 18, 2022 pm 04:55 PM

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

html5中不支持的标签有哪些html5中不支持的标签有哪些Mar 17, 2022 pm 05:43 PM

html5中不支持的标签有:1、acronym,用于定义首字母缩写,可用abbr替代;2、basefont,可利用css样式替代;3、applet,可用object替代;4、dir,定义目录列表,可用ul替代;5、big,定义大号文本等等。

html5废弃了哪个列表标签html5废弃了哪个列表标签Jun 01, 2022 pm 06:32 PM

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

html5是什么意思html5是什么意思Apr 26, 2021 pm 03:02 PM

html5是指超文本标记语言(HTML)的第五次重大修改,即第5代HTML。HTML5是Web中核心语言HTML的规范,用户使用任何手段进行网页浏览时看到的内容原本都是HTML格式的,在浏览器中通过一些技术处理将其转换成为了可识别的信息。HTML5由不同的技术构成,其在互联网中得到了非常广泛的应用,提供更多增强网络应用的标准机。

html5为什么只需要写doctypehtml5为什么只需要写doctypeJun 07, 2022 pm 05:15 PM

因为html5不基于SGML(标准通用置标语言),不需要对DTD进行引用,但是需要doctype来规范浏览器的行为,也即按照正常的方式来运行,因此html5只需要写doctype即可。“!DOCTYPE”是一种标准通用标记语言的文档类型声明,用于告诉浏览器编写页面所用的标记的版本。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft