--- title: HTMLParagraphElement slug: Web/API/HTMLParagraphElement translation_of: Web/API/HTMLParagraphElement ---
{{ APIRef("HTML DOM") }}

HTMLParagraphElement 接口可以提供超过其继承的{{domxref("HTMLElement")}} 对象额外的属性 ,用以操作 {{HTMLElement("p")}} 元素.

{{InheritanceDiagram(600, 120)}}

属性

Inherits properties from its parent, {{domxref("HTMLElement")}}.

{{domxref("HTMLParagraphElement.align")}} {{obsolete_inline}}
A {{domxref("DOMString")}} representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center".

Methods

No specific methods, inherits methods from its parent, {{domxref("HTMLElement")}}.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "#htmlparagraphelement", "HTMLParagraphElement")}} {{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', "grouping-content.html#the-p-element", "HTMLParagraphElement")}} {{Spec2('HTML5 W3C')}} The following property is now obsolete: align.
{{SpecName('DOM2 HTML', 'html.html#ID-84675076', 'HTMLParagraphElement')}} {{Spec2('DOM2 HTML')}} No change from {{SpecName("DOM1")}}.
{{SpecName('DOM1', 'level-one-html.html#ID-84675076', 'HTMLParagraphElement')}} {{Spec2('DOM1')}} Initial definition.

Browser compatibility

{{Compat("api.HTMLParagraphElement")}}

See also