Référence HTML : class
L'attribut class
- Type : CDATA
- Valeur par défaut : #IMPLIED
Description de l'attribut class
L'attribut class nous permet de spécifier une classe ou une liste de classes séparées à chaque fois par un espace.Nous pouvons donc affecter plus d'une classe à un élément, comme nous pouvons aussi affecter une même classe à plusieurs éléments.
Nous utiliserons principalement cet attribut pour affecter un ou plusieurs styles à un élément.
A voir :
- les feuilles de styles en cascades
- les id
Eléments qui peuvent utiliser cet attribut :
| a | abbr | acronym | address | applet | area | b | bdo | big | blockquote | body | br | button | caption | center | cite | code | col | colgroup | dd | del | dfn | dir | div | dl | dt | em | embed | fieldset | font | form | frame | frameset | h1 | h2 | h3 | h4 | h5 | h6 | hr | i | iframe | img | input | ins | isindex | kbd | label | legend | li | link | listing | map | menu | noframes | noscript | object | ol | optgroup | option | p | plaintext | pre | q | s | samp | select | small | span | strike | strong | sub | sup | table | tbody | td | textarea | tfoot | th | thead | tr | tt | u | ul | var | xmp |Liste des attributs et évènements
- abbr
- accept
- accept-charset
- accesskey
- action
- align
- alink
- alt
- archive
- axis
- background
- bgcolor
- border
- cellpadding
- cellspacing
- char
- charoff
- charset
- checked
- cite
- class
- classid
- clear
- code
- codebase
- codetype
- color
- cols
- colspan
- compact
- content
- coords
- data
- datetime
- declare
- defer
- dir
- disabled
- enctype
- face
- for
- frame
- frameborder
- headers
- height
- href
- hreflang
- hspace
- http-equiv
- id
- ismap
- label
- lang
- language
- link
- longdesc
- marginheight
- marginwidth
- maxlength
- media
- method
- multiple
- name
- nohref
- noresize
- noshade
- nowrap
- object
- onblur
- onchange
- onclick
- ondblclick
- onfocus
- onkeydown
- onkeypress
- onkeyup
- onload
- onmousedown
- onmousemove
- onmouseout
- onmouseover
- onmouseup
- onreset
- onselect
- onsubmit
- onunload
- profile
- prompt
- readonly
- rel
- rev
- rows
- rowspan
- rules
- scheme
- scope
- scrolling
- selected
- shape
- size
- span
- src
- standby
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 14/08/2006, last modified the 29/07/2022
Source of the printed document:https://www.gaudry.be/en/xhtml-rf-attribut/class.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.