HTML 그룹화 태그(Grouping Tags)


London

London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.

Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.

Example

<div style="background-color:black; color:white; margin:20px; padding:20px;">

<h2>London</h2>

<p>
London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.
</p>

</div>

Try it Yourself »

HTML 블록(Block) 요소와 인라인(Inline) 요소

대부분의 HTML 요소는 블록(block) 수준 요소이거나 또는 인라인(inline) 요소로 정의된다.

브라우저에서 표시될 때, 블록 수준 요소는 일반적으로 새 줄시작하거나 난다.

Examples:

인라인 요소는 일반적으로 줄 바꿈(line breaks) 없이 표시됩니다.

Examples:


HTML <div> Element

HTML <div> 요소는 다른 HTML 요소를 그룹화하는 용기(Container)로서 사용될 수 있는 블록 수준 요소이다.

<div> 요소는 특별한 의미는 없으며, 어떤 속성도 요구되지 않지만, style class 가 흔히 사용된다.

이는 블록 수준 요소이므로 브라우저는 그 이전 그 이후 줄 바꿈을 표시합니다. 

CSS와 함께 사용하면, <div> 요소는 내용의 블록에 스타일을 설정하는 데 사용할 수있다.

Example

<div style="background-color:black; color:white; padding:20px;">

<h2>London</h2>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>

</div>
Try it Yourself »

HTML <span> Element

HTML <span> 요소는 텍스트에 대한 용기(Container)로 사용할 수 있는 인라인(inline) 요소입니다.

<span> 요소는 특별한 의미가 없으며, 어떤 속성도 요구되지 않지만, style class 가 흔히 사용된다.

줄바꿈으로 형태를 취한는 <div>와는 달리, <span> 요소는 어떤 자동 포맷팅도 가지고 있지 않다.

CSS와 함께 사용될 때, <span> 요 소는 텍스트의 일정 부분에 속성 스타일을 설정하는 데 사용될 수 있다.:

Example

<h1>My <span style="color:red">Important</span> Heading</h1>
Try it Yourself »

HTML Grouping Tags

Tag Description
<div> Defines a section in a document (block-level)
<span> Defines a section in a document (inline)