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 <p> és seguit immediatament per un <address> , <article> , <aside> , <blockquote> , <div> , <dl> , <fieldset> , <footer> , <form> , <h1> , <h2> , <h3> , <h4> , <h5> , <h6> , <header> , <hr> , <menu> , <nav> , <ol> , <pre> , <section> , <table> , <ul> o una altra element <p> , o si no hi ha més contingut en l'element primari i l'element pare no és un element <a> . |
Elements pares permesos | Qualsevol element que accepti contingut dinàmic. |
Interfície DOM | HTMLParagraphElement |
Atributs
Aquest element inclou els atributs globals.
L'atribut align
a <p> és obsolet. No el feu servir.
Exemple
<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:
Notes
Per canviar els espais entre els paràgrafs, utilitzar la propietat CSS margin
. No introduir elements paràgrafs buits o <br>
entre ells.
Especificacions
Especificació | Estat | Comentari |
---|---|---|
HTML Living Standard The definition of '<p>' in that specification. |
Living Standard | Cap canvi des de l'última presentació W3C HTML5 |
HTML5 The definition of '<p>' in that specification. |
Recommendation | l'atribut align està obsolet |
HTML 4.01 Specification The definition of '<p>' in that specification. |
Recommendation | Definció inicial |
Navegadors compatibles
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Suport bàsic | 1.0 | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes) |
Característica | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Suport bàsic | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |