HTML standard attributes

While attributes can be an important part of a tag, not all tags have attributes. For those tags that do have attributes, some of these attributes are shared by the majority of tags in HTML and serve a special purpose.

Core attributes

NOTE: These attributes cannot be used in the following tags: <base>, <head>, <html>, <meta>, <param>, <script>, <style>, <title>

Attribute Value Description
class class name The elements class
id id name The elements id (should be unique)
style style definition style(s) an element will inherit
title tooltip text Text that will appear in a box next to the element

Language Attributes

NOTE: These attributes cannot be used in the following tags: base, <br>, <frame>, <frameset>, <hr>, <iframe>, <param>, <script>

Attribute Value Description
dir ltr | rtl Sets the direction of the text
lang language_code Sets the code of the language

Keyboard Attributes

Attribute Value Description
accesskey character Sets a keyboard key to access an element
tabindex number Will set the tab order of an element
© Copyright 2009-2010 Landofcode.com
Terms of use | Privacy policy | Copyright information