P có nghĩa là gì trong HTML?

HTML

tag

Đã cập nhật. 13/11/2018 của Computer Hope

P có nghĩa là gì trong HTML?

When writing in HTML, the

tag is a block element used to designate a paragraph. It is useful because Internet browsers add a bit of margin before after each element. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Mẹo

Các lề mặc định xung quanh các đoạn văn nên được điều chỉnh bằng CSS

Example of code

Hey, I'm a paragraph with some text in me.

kết quả ví dụ

Này, tôi là một đoạn văn với một số văn bản trong tôi

Thuộc tính không dùng nữa

Trong thẻ HTML, một thuộc tính chỉ ra các khía cạnh nhất định của phần tử HTML. Các thuộc tính được tạo thành từ một cặp tên và giá trị; . Thuộc tính duy nhất duy nhất của

thẻ không được dùng nữa, nghĩa là thẻ hiện có thể hoạt động nhưng không được hỗ trợ trong tương lai. Trong trường hợp này, nên sử dụng CSS thay cho các thuộc tính này

Tác phẩm duy nhất còn sót lại của Wang là 11. Cuộn giấy dài 9 mét (39 ft) có tiêu đề Một nghìn lý sông và núi. Bức tranh được Vương hoàn thành khi ông mới 18 tuổi vào năm 1113, là một trong những bức tranh lớn nhất trong lịch sử Trung Quốc và được mô tả là một trong những tác phẩm nghệ thuật Trung Quốc vĩ đại nhất. Bức tranh nằm trong bộ sưu tập vĩnh viễn của Bảo tàng Cung điện ở Bắc Kinh

Tranh phong cảnh Trung Quốc đọc là xem, từ phải qua trái. Nhưng gần đây các học giả cho rằng bức tranh này nên được xem như toàn cảnh. Có lẽ, ông đã sử dụng kỹ thuật "tắc phong Trung Quốc" và sử dụng màu xanh lá cây và xanh lam của nhà Đường để tạo ra những cảnh quan rộng lớn. Bức tranh lụa khổ lớn nên được đặt trên bức tường cũ sờn thời gian. Nhìn qua nó vào lúc bình minh hoặc buổi tối, một nghệ sĩ có thể thấy những phong cảnh mà sau này anh ta sẽ mô tả trong bức tranh của chính mình

thẻ là thẻ cặp nên bắt buộc phải đóng thẻ này. Nếu ta không đóng thẻ này thì trình soạn thảo Html sẽ lấy từng dòng trong đoạn

Chúng ta cũng có thể sử dụng thuộc tính align trong thẻ đoạn văn. Thuộc tính align căn chỉnh văn bản trong một đoạn văn

thẻ xác định một đoạn văn bản. Nó là một phần tử cấp khối và luôn bắt đầu trên một dòng mới. Trước và sau mỗi đoạn, trình duyệt sẽ tự động thêm lề. Bạn có thể sửa đổi lề bằng thuộc tính lề CSS

Nếu bạn chỉ cần di chuyển văn bản sang một dòng mới, hãy sử dụng
nhãn

Các

thẻ đi theo cặp. Nội dung được viết giữa phần mở đầu (

) và đóng (

) thẻ. Nếu thẻ đóng bị bỏ qua, nó được coi là phần cuối của đoạn khớp với phần đầu của phần tử cấp khối tiếp theo

Khoảng cách giữa lỗ mở

thẻ và nội dung của nó bị trình duyệt bỏ qua. Để đặt thụt lề, hãy sử dụng thuộc tính CSS text-indent

Các

thẻ không được chứa bảng và các phần tử cấp khối khác



  
    Title of the document
  
  
    

This is a paragraph

P có nghĩa là gì trong HTML?

Để căn chỉnh văn bản trong một đoạn văn, thay vì thuộc tính căn chỉnh đã lỗi thời, hãy sử dụng thuộc tính CSS text-align

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt utlabore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercite ullamcolaboris nisi ut aliquip ex ea commodo do đó. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Ngoại lệ sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id estlaborum

Phần tử HTML

đại diện cho một đoạn văn. Các đoạn thường được thể hiện trong phương tiện trực quan dưới dạng các khối văn bản được phân tách khỏi các khối liền kề bằng các dòng trống và/hoặc thụt đầu dòng ở dòng đầu tiên, nhưng các đoạn HTML có thể là bất kỳ nhóm cấu trúc nào của nội dung liên quan, chẳng hạn như hình ảnh hoặc trường biểu mẫu

Các đoạn văn là các phần tử cấp khối và đáng chú ý là sẽ tự động đóng nếu một phần tử cấp khối khác được phân tích cú pháp trước thẻ đóng

. Xem phần "Thiếu thẻ" bên dưới

Danh mục nội dung, nội dung sờ thấy. nội dung được phép. Bỏ qua thẻThẻ bắt đầu là bắt buộc. Thẻ kết thúc có thể bị bỏ qua nếu phần tử

được theo ngay sau bởi một

,
,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
0,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
1,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
2,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
3,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
4,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
5,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
6,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
7,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
8,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
9,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
0,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
1,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
2,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
3,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
3,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
4, . Cha mẹ được phép Bất kỳ phần tử nào chấp nhận. Vai trò ARIA ngầm định Vai trò ARIA được phép Giao diện AnyDOM_______22_______4

Phần tử này chỉ bao gồm các thuộc tính toàn cầu

Ghi chú. Thuộc tính

document.querySelector('button').addEventListener('click', (event) => {
  document.querySelectorAll('p').forEach((paragraph) => {
    paragraph.classList.toggle('pilcrow');
  });

  [event.target.innerText, event.target.dataset.toggleText] =
    [event.target.dataset.toggleText, event.target.innerText];
});
5 trên thẻ

đã lỗi thời và không nên sử dụng

<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 the second paragraph. This is the second paragraph. This is the second
  paragraph. This is the second paragraph.
p>

Theo mặc định, các trình duyệt phân tách các đoạn bằng một dòng trống. Có thể đạt được các phương pháp phân tách thay thế, chẳng hạn như thụt lề dòng đầu tiên bằng CSS

<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>

p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}

document.querySelector('button').addEventListener('click', (event) => {
  document.querySelectorAll('p').forEach((paragraph) => {
    paragraph.classList.toggle('pilcrow');
  });

  [event.target.innerText, event.target.dataset.toggleText] =
    [event.target.dataset.toggleText, event.target.innerText];
});

Chia nhỏ nội dung thành các đoạn giúp làm cho trang dễ truy cập hơn. Trình đọc màn hình và công nghệ hỗ trợ khác cung cấp lối tắt để cho phép người dùng chuyển sang đoạn tiếp theo hoặc đoạn trước đó, cho phép họ đọc lướt qua nội dung như cách khoảng trắng cho phép người dùng trực quan bỏ qua

Việc sử dụng các phần tử

trống để thêm khoảng trắng giữa các đoạn văn là một vấn đề đối với những người điều hướng bằng công nghệ đọc màn hình. Trình đọc màn hình có thể thông báo sự hiện diện của đoạn văn, nhưng không phải bất kỳ nội dung nào chứa trong đó — bởi vì không có. Điều này có thể khiến người sử dụng trình đọc màn hình bối rối và khó chịu