--- title:
slug: Web/HTML/Element/p tags: - Element - HTML - HTML grouping content - Reference - Web translation_of: Web/HTML/Element/p ---
L'element HTML <p>
(o element HTML Paràgraf ) representa un paràgraf de text. Els paràgrafs solen estar representats en els mitjans visuals com a blocs de text que estan separats dels blocs adjacents per un espai en blanc vertical i/o una sagnia de primera línia. El paràgraf ha d'estar tancat al final del text utilitzant el format "<p> text </ p>" per col·locar el text entre el paràgraf. Els paràgrafs són elements de bloc.
Categories de contingut | Contingut dinàmic, contingut palpable. |
---|---|
Contingut permès | Phrasing content. |
Omissió de l'etiqueta | L'etiqueta d'inici és obligatòria. L'etiqueta final es pot ometre si l'element {{HTMLElement("p")}} és seguit immediatament per un {{HTMLElement("address")}}, {{HTMLElement("article")}}, {{HTMLElement("aside")}}, {{HTMLElement("blockquote")}}, {{HTMLElement("div")}}, {{HTMLElement("dl")}}, {{HTMLElement("fieldset")}}, {{HTMLElement("footer")}}, {{HTMLElement("form")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}, {{HTMLElement("header")}}, {{HTMLElement("hr")}}, {{HTMLElement("menu")}}, {{HTMLElement("nav")}}, {{HTMLElement("ol")}}, {{HTMLElement("pre")}}, {{HTMLElement("section")}}, {{HTMLElement("table")}}, {{HTMLElement("ul")}} o una altra element {{HTMLElement("p")}}, o si no hi ha més contingut en l'element primari i l'element pare no és un element {{HTMLElement("a")}}. |
Elements pares permesos | Qualsevol element que accepti contingut dinàmic. |
Interfície DOM | {{domxref("HTMLParagraphElement")}} |
Aquest element inclou els atributs globals.
L'atribut align
a <p> és obsolet. No el feu servir.
<p>This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.</p> <p>This is second paragraph of text. This is second paragraph of text. This is second paragraph of text. This is second paragraph of text.</p>
Això genera:
{{EmbedLiveSample('Example')}}
Per canviar els espais entre els paràgrafs, utilitzar la propietat CSS {{cssxref("margin")}}. No introduir elements paràgrafs buits o {{HTMLElement("br")}} entre ells.
Especificació | Estat | Comentari |
---|---|---|
{{SpecName('HTML WHATWG', 'grouping-content.html#the-p-element', '<p>')}} | {{Spec2('HTML WHATWG')}} | Cap canvi des de l'última presentació W3C {{SpecName("HTML5 W3C")}} |
{{SpecName('HTML5 W3C', 'grouping-content.html#the-p-element', '<p>')}} | {{Spec2('HTML5 W3C')}} | l'atribut align està obsolet |
{{SpecName('HTML4.01', 'struct/text.html#h-9.3.1', '<p>')}} | {{Spec2('HTML4.01')}} | Definció inicial |
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Suport bàsic | 1.0 | {{CompatGeckoDesktop("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Característica | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Suport bàsic | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |