English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Dieser Artikel beschreibt, wie die HTML-div-align-Eigenschaft die horizontale Ausrichtung des Inhalts innerhalb eines <div>-Elements bestimmt, zeigt Online-Beispiele, wie man die HTML-div-align-Eigenschaft, die Kompatibilität der Browser, die Syntaxdefinition und die detaillierten Informationen zu seinen Eigenschaftswerten verwendet.
Die im Dokument zentrierten Bereiche:
!DOCTYPE html <html> <head> <meta charset="utf-8"> <title>HTML <div> align Eigenschaft verwenden-Grund教程(oldtoolbag.com)</title> </head> <body> <p>Das ist ein Absatz. Der Text hat keine Ausrichtung angegeben.</p> <div align="center" style="border:1px solid red"> Dies sind einige Texte im div-Element! </div> <p>Das ist ein Absatz. Der Text hat keine Ausrichtung angegeben.</p> </body> </html>Testen Sie, ob es funktioniert ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the align attribute.
HTML5The <div> align attribute is no longer supported in CSS, please use CSS instead.
The align attribute of <div> in HTML 4.01 has been deprecated. in HTML 4.01.
The align attribute specifies the horizontal alignment of the content within the <div> element.
HTML5The <div> align attribute is no longer supported in CSS, please use CSS instead.
CSS Syntax: <div style="text-align:center">
CSS Example: Reduce the line height in the list
In our CSS tutorial, you can find more abouttext-align Attributedetails.
<div align="left|right|center|justify">
Value | Description |
---|---|
left | Align the content to the left. |
right | Align the content to the right. |
center | Align the content centrally. |
justify | Extend the line, so that each line can have an equal length (like in newspapers and magazines). |