display Property


Home > Document > CSS > Classification > display

ÆäÀÌÁö ¸ñÂ÷



display Property

display Property ´Â Inline Element ³ª Block-Level Element °¡ È­¸é »ó¿¡ Render µÇ´Â ¹æ½ÄÀ» ´Ù·ç´Â Property ÀÔ´Ï´Ù. È­¸é »ó¿¡ ³ªÅ¸³ª´Â Element ´Â ¸ðµÎ Inline À̳ª Block ÀÔ´Ï´Ù. Inline(Line ¼Ó¿¡ ÀÖ´Ù... Áï, °°Àº ÁÙ ¼Ó¿¡¼­ ÁٹٲÞÀÌ ¾øÀÌ ¿¬¼ÓÀûÀ¸·Î À̾îÁö´Â element) Element ¶õ SPAN, FONT µî°ú °°ÀÌ ÁٹٲÞÀÌ ¾ø´Â Element¸¦ ¸»Çϰí, Block-Level Element ´Â DIV, P, H1 ~ H6 µî°ú °°ÀÌ ÁٹٲÞÀÌ »ý±â´Â Element¸¦ ¸»ÇÕ´Ï´Ù. ÇÏÁö¸¸ ÀÌ ÆäÀÌÁöÀÇ display Property¸¦ »ç¿ëÇϸé block Element¸¦ Inline À¸·Î, ¹Ý´ë·Î Inline Element ¸¦ Block Element·Î È­¸é »ó¿¡ Rendering µÇ°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¶Ç È­¸é »ó¿¡ ³ªÅ¸³ªÁö ¾Ê°Ô(none) ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ¾Æ·¡ Ç¥ÀÇ °ª Áß¿¡ ±½Àº ±Û¾¾·Î µÈ Keyword ¸¸ ÀÛµ¿ÇÏ°í ³ª¸ÓÁö´Â ÀÛµ¿ÇÏÁö ¾Ê½À´Ï´Ù.

  [Ç¥ º¸´Â ¹æ¹ý]
Property
Value inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | Inherit | inline-block (*IE Only)
Initial inline
Applies to all elements
Inherited no
Percentages N/A
Media Visual
HTML Syntax { display: sDisplay }
Scripting object.style.display [ = sDisplay ]




CSS Scripting
onMouseDown="this.style.display='block';"




SPANÀÌ DIV¸¦ ¸¸³µÀ» ¶§...

Block Element °¡ ÁٹٲÞÀ» ÇÑ´Ù°í Çߴµ¥, ÀÌ ÁٹٲÞÀ̶õ ´ÙÀ½ ÁÙ·Î ¹Ù²î´Â ÁٹٲÞÀ» ¹°·ÐÀ̰í, ÀڽŠ¾Õ¿¡ ÀÖ´Â Element ¿ÍÀÇ Áٹٲ޵µ Æ÷ÇÔ µË´Ï´Ù. Áï, Block Element ÀÇ À§¿Í ¾Æ·¡·Î ÁٹٲÞÀÌ µÇ¾î¼­ È¥ÀÚ ÇÑ ÁÙÀ» Â÷ÁöÇÑ´Ù´Â ¸»ÀÌÁ®. ¾Æ·¡ÀÇ Source code¿Í Ãâ·Â °á°ú ÂüÁ¶...

ÀÔ·Â
<HTML>
    <HEAD>
        <TITLE>SPANÀÌ DIV¸¦ ¸¸³µÀ» ¶§...</TITLE>
    </HEAD>
    <BODY>
        <SPAN style="width:50px; height:50px; background-color:gold; "></SPAN>
        <DIV style="width:50px; height:50px;  background-color:tomato; "></DIV>
    </BODY>
</HTML>
Ãâ·Â°á°ú

°á°ú¸¦ º¸¸é ¾Ë ¼ö ÀÖÁö¸¸ ÁٹٲÞÀÌ ¾ø´Â SPAN Element µÚ¿¡ ÁٹٲÞÀÌ ÀÖ´Â DIV Element °¡ ¿À¸é DIV Tag À§·Îµµ ÁٹٲÞÀÌ »ý±ä´Ù´Â °ÍÀ» ¾Ë ¼ö ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ¾Æ·¡¿Í °°ÀÌ...

ÀÔ·Â - {display:inline}
<HTML>
    <HEAD>
        <TITLE>SPANÀÌ DIV¸¦ ¸¸³µÁö¸¸...</TITLE>
    </HEAD>
    <BODY>
      <SPAN style="width:50px; height:50px; background-color:gold; "></SPAN>
      <DIV style="width:50px; height:50px;  background-color:tomato; display:inline;"></DIV>
    </BODY>
</HTML>
Ãâ·Â°á°ú

À§¿Í °°ÀÌ display:inline À» ÁöÁ¤Çϸé Block Elementµµ Inline Element ó·³ Render µË´Ï´Ù. ¹Ý´ë·Î Inline Element ¸¦ Block Element ó·³ Render ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ´ÙÀ½ÀÇ ¿¹Á¦¸¦ º¾½Ã´Ù.



SPAN°ú SPANÀÌ ¸¸³ª¸é...

À̹ø ¿¹Á¦´Â Inline Element ÀÎ SPAN Element¸¦ Block Element·Î Render ÇÏ´Â ¹æ¹ý¿¡ ´ëÇØ ¾Ë¾Æ º¸°Ú½À´Ï´Ù.

ÀÔ·Â - {display:block}
<HTML>
  <HEAD>
    <TITLE>SPAN°ú SPANÀÌ ¸¸³ª¸é...</TITLE>
  </HEAD>
  <BODY>
    <SPAN style="width:50px; height:50px; background-color:gold; "></SPAN>
    <SPAN style="width:50px; height:50px;background-color:tomato;display:block; "></SPAN>
  </BODY>
</HTML>
Ãâ·Â°á°ú




¹®´Ü ¼Ó¿¡¼­ÀÇ display Property »ç¿ë

´ÙÀ½Àº ¹®Àå ¼Ó¿¡¼­ 2°³ÀÇ SPAN Tag ¿¡ display Property ¸¦ ÁöÁ¤ÇÏ¿© display:inline. display:block, display:none ÀÇ 3 °¡Áö Keyword ¸¦ ÁöÁ¤ÇßÀ» °æ¿ìÀÇ DHTML°ú Source code ÀÔ´Ï´Ù.

display Property DHTML
display Property¸¦ ÁöÁ¤ÇÑ SPAN Tag display Property¸¦ ÁöÁ¤ÇÏÁö ¾ÊÀº SPAN Tag
Inline Block None

Source code
<HTML>
    <HEAD>
        <TITLE>¹®´Ü ¼Ó¿¡¼­ÀÇ display Property »ç¿ë</TITLE>
    </HEAD>
    <BODY>
    <SPAN id="span_1" style="color:tomato;background-color:#EFEFEF;">
        <B>display Property¸¦ ÁöÁ¤ÇÑ SPAN Tag</B>
    </SPAN>
    <SPAN style="background-color:gold;"> display Property¸¦ ÁöÁ¤ÇÏÁö ¾ÊÀº SPAN Tag</SPAN>
    <table cellspacing="2" width="100%" style="table-layout:fixed;border:1px solid #333333;">
      <tr>
        <td class="td_button2" onClick="span_1.style.display='inline';">Inline</td>
        <td class="td_button2" onClick="span_1.style.display='block';">Block</td>
        <td class="td_button2" onClick="span_1.style.display='none';">None</td>
      </tr>
    </table>
    </BODY>
</HTML>




{ display : list-item } (Ãß°¡ ºÎºÐ)

list-itemÀº ¸¶Ä¡ UL(Unordered List) À̳ª OL(Ordered List) ¿Í °°ÀÌ È­¸é¿¡ display ½ÃÄÑÁÝ´Ï´Ù. µû¶ó¼­ SPAN °ú °°Àº Inline Element¿¡ »ç¿ëÇØµµ LI ¿Í °°ÀÌ block ÇüÅ·Πȭ¸é¿¡ render µË´Ï´Ù. ±Û¸Ó¸® ±âÈ£ÀÇ ÇüÅ´ list-style-type ÀÇ default ÇüÅÂÀÎ disc À̰í, Çʿ信 µû¶ó list-style-type CSS Property·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ ¶§ upper-alpha µîÀÇ OL Çü½ÄÀ» »ç¿ëÇÏ¸é ³»¿ë ¾ø¾îµµ Enter·Î ÁÙÀÌ ¹Ù²ð ¶§ ¸¶´Ù ¹øÈ£°¡ 1 ¾¿ Áõ°¡ÇÕ´Ï´Ù. ¾Æ·¡ÀÇ ¿¹Á¦¿¡¼­ÀÇ <br /> ÀÌ 2°³ ¾¿ µé¾î°£ °Í ±îÁö Count ÇÑ´Ù´Â ¶æÀÔ´Ï´Ù.

display : list-item ¿¹Á¦
<html>
<head>
<title>display : list-item</title>
    <style type="text/css">
    <!-- 
    span.symbol{display:list-item; list-style-type:square;}
    span.deca{display:list-item; list-style-type:decimal;}
    span.roman_U{display:list-item; list-style-type:upper-roman;}
    span.alpah_U{display:list-item; list-style-type:upper-alpha;}
    -->
    </style>
</head>
<body>
    <div style="padding-left:50px;">
        <span class="symbol">Square 1</span>
        <span class="symbol">Square 2</span>
        <span class="symbol">Square 3</span>
        <br /><br />
        <span class="deca">Number 1</span>
        <span class="deca">Number 2</span>
        <span class="deca">Number 3</span>
        <br /><br />
        <span class="roman_U">Roman 1</span>
        <span class="roman_U">Roman 2</span>
        <span class="roman_U">Roman 3</span>
        <br /><br />
        <span class="alpah_U">Alphabet 1</span>
        <span class="alpah_U">Alphabet 2</span>
        <span class="alpah_U">Alphabet 3</span>
    </div>
</body>
</html>
ÄÚµå ½ÇÇà Çϱâ



{ display : table-header-group }, { display : table-footer-group }

table-header-group°ú table-footer-group Àº °¢°¢ HTML ElementÀÎ THEAD¿Í TFOOT Element ¿¡¼­ ÀÛµ¿ ÇÕ´Ï´Ù. ÀÌ µÎ °¡Áö Property´Â ÄÄÇ»ÅÍ ¸ð´ÏÅÍ »ó¿¡¼­ Ãâ·Â ÇÒ ¸ñÀûÀ¸·Î ¸¸µç Property°¡ ¾Æ´Ï°í, ÇÑ ÆäÀÌÁö°¡ ³Ñ´Â ¿©·¯ ÆäÀÌÁö ºÐ·®ÀÇ TableÀ» Printer·Î Ãâ·ÂÇÒ ¶§, ¸Å ÆäÀÌÁö¸¶´Ù Å×ÀÌºí ¸Ó¸®¸»(THEAD)°ú ²¿¸®¸»(TFOOT)À» ³Ö¾îÁÖ±â À§ÇØ »ç¿ëÇÏ´Â Keyword °¡ µÇ½Ã°Ú½À´Ï´Ù.

»ç¿ë ¹æ¹ýÀº ¾Æ·¡¿Í °°ÀÌ table-head-groupÀº THEAD Tag ¿¡ ÁöÁ¤Çϰí, table-footer-groupÀº TFOOT Tag¿¡ ÁöÁ¤ÇÕ´Ï´Ù.

ÀÔ·Â
<HTML>
    <HEAD>
        <TITLE>Table HEADER¿Í FOOTER¸¦ ¸Å ÆäÀÌÁö¸¶´Ù ÇÁ¸°Æ® Çϱâ</TITLE>
    </HEAD>
    <BODY>
        <TABLE border="1" cellpadding="0" cellspacing="0" width="100%">		
                <THEAD align="center" style="display:table-header-group;">
                    <TR>
                        <TD colspan="5">Table Header</td>
                    </TR>
                </THEAD>
                <TBODY bgcolor="gold" align="center">
                <TR>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                </TR>
                .
                .
                <TR>¿¡¼­ </TR>À» ¾öû½Ã·¹ ¸¹ÀÌ º¹»ç ÇÒ °Í. ´ë·« 100°³ Á¤µµ?...
                .
                .
                <TR>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                    <TD>Cell</TD>
                </TR>
            <TFOOT style="display:table-footer-group;">
                <TR>
                    <TD colspan="5">Table Footer</TD>
                </TR>
            </TFOOT>
        </TABLE>
    </BODY>
</HTML>

ÀÌ °á°ú¸¦ º¸¿© Áشٴ °ÍÀÌ ÂüÀ¸·Î ³­°¨Çϱº¿ä. Á÷Á¢ ÇÁ¸°Æ®¸¦ ÇØ ºÁ¾ß ´«¿¡ º¸À̱⠶§¹®ÀÌÁÒ. ÇÏÁö¸¸ ¹Ýµå½Ã Á¾ÀÌ¿¡ ÇÁ¸°Æ®¸¦ ÇØ ºÁ¾ß µÇ´Â °ÍÀº ¾Æ´Õ´Ï´Ù. À§ÀÇ Code¸¦ ºê¶ó¿ìÀú·Î ½ÇÇà ÇÑ ´ÙÀ½ ¸ÞÀθ޴º ÆÄÀÏ / Àμ⠹̸®º¸±â(V)... ¸¦ ÇÏ°í ´ÙÀ½ ÆäÀÌÁö¸¦ º¸¸é °¢ ÆäÀÌÁö ¸¶´Ù Table header¿Í Table footer°¡ ºÙ¾î ÀÖ´Â °ÍÀ» È®ÀÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù.



{ display : inline-block }

inline-block À̶õ Block Element°¡ ´Ù¸¥ Block Element ¼Ó¿¡ inlineÀ¸·Î µé¾î °¬À» ¶§ BlockÀ¸·Î Render µÇ°Ô ÇÏ´Â Keyword ÀÔ´Ï´Ù. ¾Æ·¡ÀÇ P TagÀ» º¸¸é Mouse Event¸¦ Àû¿ëÇßÀ» ¶§ ±ÛÀÚ »Ó¸¸ ¾Æ´Ï¶ó P TagÀÌ Â÷ÁöÇϰí ÀÖ´Â Line Àüü¿¡ Mouse ActionÀÌ »ý±â°Ô µË´Ï´Ù. Mouse¸¦ ¾Æ·¡ÀÇ È¸»öÁÙ ¾Æ¹« °÷¿¡³ª ¿Ã·Á º¸½ÃÁ®...

   Line Àüü¿¡ Mouse actionÀÌ »ý±ä´Ù.

Source code
.
.
<BODY>
<P onmouseover="this.style.color='tomato';" onMouseOut="this.style.color='';"
style="background-color:#DEDEDE;">
   Line Àüü¿¡ Mouse actionÀÌ »ý±ä´Ù.
</P>
</BODY>
.
.


ÇÏÁö¸¸ P TagÀÌ °°Àº Block ElementÀÎ DIV °°Àº Tag ¼Ó¿¡ µé¾î°¡¸é ¾ê±â°¡ ´Þ¶óÁö°Ô µË´Ï´Ù. ¾Æ·¡ÀÇ Source code¿Í Ãâ·Â °á°ú¸¦ º¸½ÃÁ®.

Source code
.
.
<BODY>
<DIV style="background-color:gold;">
<P onmouseover="this.style.color='tomato';" onMouseOut="this.style.color='';"
style="background-color:#DEDEDE;">
   Line Àüü¿¡ Mouse actionÀÌ »ý±ä´Ù.
</P>
</DIV>
</BODY>
.
.


Ãâ·Â°á°ú

Mouse°¡ ±ÛÀÚ À§¿¡ ¿Ã¶ó °¬À» ¶§¸¸ Mouse actionÀÌ »ý±ä´Ù.

±×·¸±â ¶§¹®¿¡ Line Àüü¿¡ ¾î¶² Mouse actionÀ» ÁÙ Çʿ䰡 ÀÖÀ» ¶§ ¹Ù·Î 'inline-block' À̶ó´Â °ªÀ» Á־ P TagÀ» ¿ø·¡ÀÇ block ÇüÅ·Π³ªÅ¸ ³¾ ¼ö ÀÖ½À´Ï´Ù. inline-block À̶ó´Â °ªÀº Internet Explorer¿¡¼­¸¸ ÀÛµ¿ÇÕ´Ï´Ù. ¾Æ·¡¿Í °°ÀÌ CodingÇϰí Ãâ·Â °á°ú¸¦ º¸½ÃÁ®.

Source code
.
.
<BODY>
<DIV style="background-color:gold;">
<P onmouseover="this.style.color='tomato';" onMouseOut="this.style.color='';"
style="background-color:#DEDEDE;display:inline-block;">
   P TagÀÌ º»¿¬ÀÇ ÀÚ¼¼·Î µ¹¾Æ°¡´Ù.
</P>
</DIV>
</BODY>
.
.


Ãâ·Â°á°ú

P TagÀÌ º»¿¬ÀÇ ÀÚ¼¼·Î µ¹¾Æ°¡´Ù.





{ display : none }, { display : block }

¾ÆÁÖ Àç¹ÌÀÖ´Â Property ÀÔ´Ï´Ù. HTML ¸Þ´º¿¡¼­ ÁÖ·Î ¸¹ÀÌ º¸¿©Áá´ø 'º¸À̱â', '°¨Ãß±â' Button¿¡ »ç¿ëµÈ CSS PropertyÁÒ. display Property ÀÇ °ªÀ» 'none' À¸·Î ÇÏ¸é ¸éÀû ÀÚü°¡ ¾ø¾îÁö°í, °ªÀ» 'block'À¸·Î ÁÖ¸é ºê¶ó¿ìÀú â¿¡¼­ ¸éÀûÀ» ´Ù½Ã Â÷ÁöÇÏ°Ô µË´Ï´Ù. ¶ÇÇÑ ¸Å ÆäÀÌÁö¸¶´Ù Counter ¸¦ ´Þ¾Æ¼­ Page View¸¦ ¾Ë°í ½ÍÀ» ¶§µµ noneÀ¸·Î °ªÀ» ÁÖ°Ô µÇ¸é È­¸é »ó¿¡´Â ³ªÅ¸³ªÁö ¾ÊÁö¸¸ ¹®¼­ ÀÛ¼ºÀÚ´Â Source fileÀ» ¿­¾î¼­ Page View ¸¦ È®ÀÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù. Mouse Action¿¡ ÀÇÇØ¼­ ÇÊ¿äÇÒ ¶§¸¸ È­¸é »ó¿¡ display½ÃÄѼ­ link¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ°Ô ÇÑ ¾Æ·¡ÀÇ ¿¹Á¦¸¦ Âü°í ÇϽÃÁ®...

ÀÔ·Â
<HTML>
    <HEAD>
        <TITLE>{ display : none }, { display : block }</TITLE>
    <STYLE type="text/css">
    <!-- 
    .menuTitle{ 
    width:300px; 
    height:30px; 
    border:1px solid #808080; 
    cursor:hand;
    }
    
    .blk { 
    display:inline-block; 
    width:300px; 
    height:300px; 
    border:1px solid tomato; 
    background-color:#c0c0c0;
    padding:10px;
    }
    
    .non { 
    display:none; 
    position:relative; 
    top:-19px; 
    left:0px;
    }
    -->
    </STYLE>
    </HEAD>
    <BODY>
        <CENTER>
            <DIV>
                <DIV class="menuTitle" onMouseOver="div_1.className='blk';" 
                onMouseout="div_1.className='non';">
                    Mouse¸¦ ¿Ã¸®¸é ¾Æ·¡¿¡ ¸µÅ©°¡ ³ª¿É´Ï´Ù.
                </DIV>
                <DIV id="div_1" class="non" onClick="div_1.className='non';" 
                onMouseOver="div_1.className='blk';" onMouseout="div_1.className='non';">
                    <A href="http://kr.yahoo.com" target="_blank">¾ßÈÄ ÄÚ¸®¾Æ</A><BR>
                    <A href="http://www.naver.com" target="_blank">³×À̹ö ÄÚ¸®¾Æ</A>
                </DIV>
            </DIV>
        </CENTER>
    </BODY>
</HTML>
Ãâ·Â°á°ú

°ü·Ã ¸µÅ©





ÀÌ ¹®¼­ÀÇ ÀúÀÛ±ÇÀº www.cadvance.org ¿¡ ÀÖ½À´Ï´Ù.

Top
Back
New
°Ë»ö