¾È±Ô °øºÎ¹æ

Javascript & JQuery & CSS > Position - static, absolute, fixed, relative

µî·ÏÀÏ : 2017-07-14 17:55 Á¶È¸¼ö : 53,004

positionÀº ¿ä¼ÒÀÇ À§Ä¡¸¦ Á¤ÇÒ ¶§ ¾îµð¸¦ ±âÁØÀ¸·Î ÇÒÁö Á¤ÇÏ´Â ¼Ó¼ºÀÔ´Ï´Ù.
¼Ó¼º°ªÀº static, absolute, fixed, relative°¡ ÀÖÀ¸¸ç, ±âº»°ªÀº staticÀÔ´Ï´Ù.
À§Ä¡¸¦ °è»êÇÒ ±âÁØÀ» Á¤ÇÏ°í ³ª¸é top, right, bottom, left ¼Ó¼ºÀ¸·Î À§Ä¡¸¦ Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
´Ü, positionÀÇ ¼Ó¼º°ªÀ¸·Î staticÀ» »ç¿ëÇϸé top, right, bottom, left¸¦ ¼³Á¤Çصµ Àû¿ëµÇÁö ¾Ê½À´Ï´Ù. °£´ÜÇÑ ¿¹´Â ´ÙÀ½°ú °°½À´Ï´Ù.

	.container {
        width: 300px;
        height: 300px;
        margin: auto;
        border: 1px solid #da9627;
        background-color: #ffb848;
      }
    .po {
        width: 200px;
        border: 1px solid #17a668;
        background-color: #27a9e3;
        position: static;
        top: 100px;
        left: 100px;
      }

ÆĶõ ¹Ú½ºÀÇ positionÀ» staticÀ¸·Î ¼³Á¤Ç߱⠶§¹®¿¡ HTML ¿ä¼ÒÀÇ °èÃþ±¸Á¶¿Í ¼ø¼­¿¡ ¸Â°Ô À§Ä¡ÇÕ´Ï´Ù. ±×¸®°í, top°ú left ¼Ó¼ºÀº ¾Æ¹«·± Àǹ̰¡ ¾ø½À´Ï´Ù. ÀÌÁ¦ ¼Ó¼º°ªÀ» absoluteÀ¸·Î ¹Ù²ãº¸°Ú½À´Ï´Ù. position: absolute;

¼Ó¼º°ªÀ» fixed·Î ¹Ù²ãº¸°Ú½À´Ï´Ù.

position: fixed; À¥ºê¶ó¿ìÀúÀÇ ²ÀÁþÁ¡À» ±âÁØÀ¸·Î À§Ä¡°¡ °è»êµË´Ï´Ù. µû¶ó¼­ ½ºÅ©·ÑÀ» Çصµ À§Ä¡°¡ º¯ÇÏÁö ¾Ê½À´Ï´Ù.



¼Ó¼º°ªÀ» relative·Î ¹Ù²ãº¸°Ú½À´Ï´Ù. position: relative; staticÀÏ ¶§ÀÇ À§Ä¡¸¦ ±âÁØÀ¸·Î À§Ä¡¸¦ °è»êÇÕ´Ï´Ù.
ÁÖÀÇÇÒ Á¡Àº ¿ø·¡ÀÇ ÀÚ¸®°¡ ´Ù¸¥ ¿ä¼Ò·Î ä¿öÁöÁö ¾Ê°í °ø¹éÀ¸·Î ³²´Â´Ù´Â °ÍÀÔ´Ï´Ù.



absoluteÀÌ ¹®¼­ÀÇ ²ÀÁþÁ¡À» ±âÁØÀ¸·Î À§Ä¡¸¦ °è»êÇÏÁö¸¸, »óÀ§ ¿ä¼Ò¿¡ relative¸¦ °¡Áø ¿ä¼Ò°¡ ÀÖ´Ù¸é, ±× ¿ä¼ÒÀÇ ²ÀÁþÁ¡À» ±âÁØÀ¸·Î °è»êÇÕ´Ï´Ù. ÁÖȲ»ö ¹Ú½º¿¡ position: relative;¸¦ Ãß°¡ÇÏ°í, ÆĶõ»ö ¹Ú½ºÀÇ À§Ä¡¸¦ Á¤Çغ¸°Ú½À´Ï´Ù.

 


	.container {
	  width: 500px;
	  height: 500px;
	  margin: auto;
	  border: 1px solid #da9627;
	  background-color: #ffb848;
	  position: relative;
	}
	.po {
	  width: 200px;
	  border: 1px solid #17a668;
	  background-color: #27a9e3;
	  position: absolute;
	  top: 100px;
	  left: 100px;
	}



 

¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.