 |
|
|  |
CSS float ¼Ó¼º, clear ¼Ó¼º, z - index ¼Ó¼º |
|
|
 |
14³â Àü |
- ¹Ú½º À̵¿, Á¤·Ä(float ¼Ó¼º)
•¼Ó¼º : float
•°ª : left, right, none, inherit
•±âº»°ª : none
•Àû¿ë´ë»ó : position ¼Ó¼ºÀÇ °ªÀÌ 'static' ÀÎ ¿ä¼Ò(content ¼Ó¼ºÀ¸·Î »ý¼ºµÈ ³»¿ë Á¦¿Ü)
¼Ó¼º °ª¿¡ ´ëÇÑ Àǹ̴ ´ÙÀ½°ú °°´Ù.
float: left : ±× ¿ä¼Ò¸¦ ¿ÞÂÊÀ¸·Î floatµÈ ºí·Ï ¹Ú½º·Î ¸¸µç´Ù.
float: right : ±× ¿ä¼Ò¸¦ ¿À¸¥ÂÊÀ¸·Î floatµÈ ºí·Ï ¹Ú½º·Î ¸¸µç´Ù.
float: none : ±× ¿ä¼Ò¸¦ float ÇÏÁö ¾Ê´Â´Ù.
float ¼Ó¼ºÀ» Àû¿ëÇÏ´Â ¿ä¼Ò´Â ¾î¶°ÇÑ ÇüÅ·εç ÆøÀ» ÁöÁ¤ÇØ¾ß ÇÏ´Â ±ÔÄ¢ÀÌ ÀÖ´Ù.
float´Â µÚ¿¡ À̾îÁö´Â ´Ù¸¥ ºí·Ï ·¹º§ ¿ä¼ÒÀÇ ¹Ú½º¿¡¼µµ À¯È¿Çϸç float°¡ ÇìÁ¦µÇÁö ¾Ê´Â´Ù.(clear ¼Ó¼ºÀ¸·Î ÇØÁ¦ °¡´É)
/* float »ç¿ë ¿¹Á¦ */
div#content{
width: 200px;
height: 200px;
background-color: silver;
float: left;
}
div#side{
width: 300px;
height: 100px;
background-color: fuchsia;
}
div#footer{
width: 300px;
height: 50px;
background-color: aqua;
}
- ¹Ú½º À̵¿, Á¤·Ä ÇØÁ¦(clear ¼Ó¼º)
•¼Ó¼º : claer
•°ª : left, right, none, both, inherit
•±âº»°ª : none
•Àû¿ë´ë»ó : ºí·Ï ·¹º§ ¿ä¼Ò
¼Ó¼º °ª¿¡ ´ëÇÑ Àǹ̴ ´ÙÀ½°ú °°´Ù.
clear: none : float¿¡ ´ëÇÏ¿© ¹Ú½ºÀÇ À§Ä¡¸¦ Á¦¾àÇÏÁö ¾Ê°í float´Â °è¼ÓÇؼ À¯È¿, float´Â ÇØÁ¦µÇÁö ¾Ê´Â´Ù.
clear: left : ¿ÞÂÊÀ¸·Î floatµÈ ¹Ú½ºº¸´Ù ¾Æ·¡¿¡ »õ·Î¿î ¹Ú½º¸¦ »ý¼ºÇÏ¿© Ç¥½Ã, ¿ÞÂÊ float ÇØÁ¦
clear: right : ¿À¸¥ÂÊÀ¸·Î Ç÷ÎÆ®µÈ ¹Ú½ºº¸´Ù ¾Æ·¡¿¡ »õ·Î¿î ¹Ú½º¸¦ »ý¼ºÇÏ¿© Ç¥½Ã, ¿À¸¥ÂÊ float ÇØÁ¦
clear: both : Á¿ì·Î floatµÈ ¹Ú½ºº¸´Ù ¾Æ·¡¿¡ »õ·Î¿î ¹Ú½º¸¦ »ý¼ºÇÏ¿© Ç¥½Ã, ÁÂ¿ì ¾çÃø float ÇØÁ¦
clear ¼Ó¼ºÀº float µÈ ¹Ú½º µÚ¿¡ À̾îÁö´Â ¹Ú½º°¡ ÀÎÁ¢ÇÏÁö ¾Ê°Ô ¹èÄ¡ÇÏ´Â ¼Ó¼ºÀÌ´Ù.
/* clear »ç¿ë ¿¹Á¦ */
div#content{
width: 200px;
height: 200px;
background-color: silver;
float: left;
}
div#side{
width: 300px;
height: 100px;
background-color: fuchsia;
}
div#footer{
width: 300px;
height: 50px;
background-color: aqua;
clear: both;
}
- °ãÃÄÁö´Â ¼ø¼(z-index ¼Ó¼º)
•¼Ó¼º : z-index
•°ª : auto, Á¤¼ö, inherit
•±âº»°ª : auto
•Àû¿ë´ë»ó : position ¼Ó¼ºÀÇ °ªÀÌ 'static' ÀÌ¿ÜÀÇ ¿ä¼Ò
¼Ó¼º °ª¿¡ ´ëÇÑ Àǹ̴ ´ÙÀ½°ú °°´Ù.
z-index: auto : ±× ¹Ú½ºÀÇ °ãÃÄÁö´Â ¼ø¼´Â ºÎ¸ð ¿ä¼Ò¿Í °°´Ù. »õ·Î¿î ¼ø¼¸¦ ÁöÁ¤ÇÏÁö ¾Ê´Â´Ù.
z-index: Á¤¼ö : ±× ¹Ú½ºÀÇ °ãÃÄÁö´Â ¼ø¼¸¦ ¸í½ÃÇÏ¸ç ±âÁØÀÌ µÇ´Â '0'ÀÌ ÀÚµ¿À¸·Î ÁöÁ¤µÈ´Ù. °ªÀÌ Å« ¹Ú½º°¡ °ªÀÌ ÀÛÀº ¹Ú½ºº¸´Ù Ç×»ó ¾Õ¿¡ Ç¥½ÃµÈ´Ù. ¸¶À̳ʽº °ªµµ ÁöÁ¤ÀÌ °¡´ÉÇÏ´Ù. °°Àº °ªÀÇ ¹Ú½º´Â XHTML ¿¡¼ µÚ¿¡ ÃâÇöÇÏ´Â ¿ä¼Ò°¡ ¾Õ¿¡ Ç¥½ÃµÈ´Ù.
/* z-index »ç¿ë ¿¹Á¦ */
div#text1{
z-index: 10;
position: absolute;
width: 150px;
height: 150px;
background-color: silver;
}
div#test2{
z-index: 20;
position: absolute;
top: 50px;
left: 50px;
width: 150px;
height: 150px;
background-color: fuchsia;
}
div#test3{
z-index: 30;
position: absolute;
top: 100px;
left: 100px;
width: 150px;
height: 150px;
background-color: aqua;
}
|
|
̵̧ : 349 |
̵̧
¸ñ·Ï
|
|
|  |
|