Home  >  Article  >  Web Front-end  >  What attributes does html div have?

What attributes does html div have?

青灯夜游
青灯夜游Original
2021-12-23 15:13:598960browse

html div attributes include: align, accesskey, class, id, lang, style, title, hidden, "data-*", draggable, dropzone, spellcheck, tabindex, translate, etc.

What attributes does html div have?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

Thedc6dce4a544fdca2df29d5ac0ea9906b tag defines a separated block or a region in an HTML document. The dc6dce4a544fdca2df29d5ac0ea9906b tag is often used to group block-level elements so that they can be formatted with CSS.

What are the attributes of html div?

Attributes can provide some additional information for HTML tags, or modify HTML tags. Attributes need to be added in the start tag, and the syntax format is:

attr="value"

attr represents the attribute name, and value represents the attribute value. Attribute values ​​must be surrounded by double quotes " " or single quotes ' '.

There are many HTML attributes, which can be roughly divided into two categories:

  • Some attributes are applicable to most or all HTML tags. We call these attributes universal attributes;

  • Some attributes are only applicable to one or a few specific HTML tags. We call these attributes special attributes.

Special properties for div:

##alignleft Specifies the content in the dc6dce4a544fdca2df29d5ac0ea9906b element alignment.
Attribute Value Description
right
center
justify

Common attributes of div:

AttributeDescriptionaccesskeySet the keyboard shortcut for accessing elements. classSpecifies the class name of the element contenteditableSpecifies whether it can be edited The content of the element. contextmenuSpecifies the context menu of an element. When the user right-clicks the element, a context menu appearsdata-*Used to store custom data for the pagedirSet the text direction of the content in the element. draggableSpecify whether an element can be draggeddropzoneSpecify whether to drag data Copy, move, or link, or deletehiddenThe hidden attribute specifies that the element is hidden. idSpecifies the unique id of the elementlangSet the language code of the content in the element . spellcheckDetect whether the element is spelled incorrectlystyleSpecify the inline style of the element (inline style)tabindexSet the tab key control order of elements. titleSpecifies additional information for the element (can be displayed in a tooltip)translateSpecify whether the value of an element needs to be translated when the page is loaded
Related recommendations: "

html video tutorial"

The above is the detailed content of What attributes does html div have?. For more information, please follow other related articles on the PHP Chinese website!

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