티스토리 뷰
HTML Paragraphs(문단)
HTML의 <p> tag는 문단을 나타내는 태그입니다.
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
알아두기 : 브라우저는 만약 </p>와 같은 end tag가 없어도 자동으로 추가해줍니다. 또한, 문단이 하나 등장하면 다음 문단 사이에 약간의 여백을 추가합니다.
HTML Paragraph의 특징
아래의 코드를 봅시다
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
위와 같이 아무리 스페이스나 엔터같은 white space가 있더라도, <p>태그는 무조건 한 칸의 띄어쓰기로만 인식합니다. 그래서 줄바꿈을 하거나 문단을 한 태그에 삽입하고 싶은 경우에는 <br>태그나 <pre>..</pre> 태그를 사용해야 합니다.
<pre> tag
<pre>
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.
</pre>
<br> tag
<p>This is<br>a paragraph<br>with line breaks.</p>
'개발 > HTML,CSS' 카테고리의 다른 글
HTML style(스타일), quotation(인용), comments(주석) (0) | 2019.07.03 |
---|---|
HTML Heading(제목) (0) | 2019.07.03 |
HTML의 특징 (0) | 2019.07.03 |
HTML 소개 (0) | 2019.07.03 |
댓글