HTML <p> 태그


예시

단락은 다음과 같이 표시됩니다.

<p>This is some text in a paragraph.</p>

아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.


정의 및 사용

태그 는 <p>단락을 정의합니다.

<p> 브라우저는 자동으로 각 요소 앞뒤에 공백 한 줄을 추가합니다 .

팁: CSS를 사용하여 단락 스타일 을 지정하십시오 .


브라우저 지원

Element
<p> Yes Yes Yes Yes Yes

전역 속성

<p>태그는 HTML의 전역 속성도 지원 합니다 .


이벤트 속성

<p>태그는 HTML의 이벤트 속성 도 지원합니다 .



더 많은 예

예시

단락의 텍스트 정렬(CSS 사용):

<p style="text-align:right">This is some text in a paragraph.</p>

예시

CSS로 단락 스타일 지정:

<html>
<head>
<style>
p {
  color: navy;
  text-indent: 30px;
  text-transform: uppercase;
}
</style>
</head>
<body>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</body>
</html>

예시

 단락에 대한 추가 정보:

<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>

예시

HTML의 시 문제:

<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>

관련 페이지

HTML 튜토리얼: HTML 단락

HTML DOM 참조: 단락 개체


기본 CSS 설정

대부분의 브라우저는 <p>다음 기본값으로 요소를 표시합니다.

예시

p {
  display: block;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
}