Elements

<center>

개요 이 HTML Center (<center>)요소는 또다른 블록요소을 포함하거나, 인라인요소(Inline)를 포함할 수 있는 블록속성(block-level) 의 요소이다. 그리고 해당...

· 1min read · 1 views

개요

이 HTML Center (<center>)요소는 또다른 블록요소을 포함하거나, 인라인요소(Inline)를 포함할 수 있는 블록속성(block-level) 의 요소이다. 그리고 해당 <center> 요소안에 포함된 전체요소는 <center>의 내용안에 가운데 정렬이 된다. (통상적으로 <body>로 쓰임).

이 태그는 HTML4(또는 XHTML 1)이후에는 잘사용되지 않고, CSS의 text-align 속성이 즐겨 사용된다. <div> 요소나 <p>요소 같은 블록속성이 있는 요소에 사용될 수 있다.또 다른 방법으로는 CSS속성을 사용하여 margin-left 또는 margin-right 또는 margin을 자동(Css("margin") 를 0 auto)으로 설정한다.

DOM 인터페이스

이 요소는 HTMLElement 인터페이스를 구현합니다.

Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

예제 1

<center>
  This text will be centered.
  <p>So will this paragraph.</p>
</center>

예제 2 (CSS 대안)

<div style="text-align:center">
  This text will be centered.
  <p>So will this paragraph.</p>
</div>

예제 3 (CSS 대안)

<p style="text-align:center">
  This line will be centered.<br />
  And so will this line.
</p>

메모

Applying text-align``:center to a <div> or <p> element centers the contents of those elements while leaving their overall dimensions unchanged.

더 보기

  • text-align
  • display

Related Docs

Elements

<strong>: 강한 중요 요소

<strong> HTML 요소는 강한 중요성, 중대함 혹은 긴급한 내용임을 나타냅니다. 브라우저는 일반적으로 이 내용을 굵은 글씨로 렌더링합니다. <p> ... the most...

1min read 1 views
Elements

<style>: 스타일 정보 요소

HTML <style> 요소는 문서나 문서 일부에 대한 스타일 정보를 포함합니다. <style> p { color: #26b72b; } code { font-weight: bold; } </styl...

2min read 3 views
Elements

<sub>: 아래 첨자 요소

HTML <sub> 요소는 활자 배치를 아래 첨자로 해야 하는 인라인 텍스트를 지정합니다. 아래 첨자는 보통 더 작은 글씨 크기를 가지고, 기준선을 아래로 내려 렌더...

2min read 3 views
Elements

<template>: 콘텐츠 템플릿 요소

HTML <template> 요소는 페이지를 불러온 순간 즉시 그려지지는 않지만, 이후 JavaScript를 사용해 인스턴스를 생성할 수 있는 HTML 코드를 담을 방법을 제공합...

1min read 3 views

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment

로그인 후 댓글을 남길 수 있습니다.