°³Ã¼ÀÇ °¢ top, right, bottom, left ÆíÀÇ ¸¶ÁøÀÇ ³Êºñ¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.

Àμö
cssSelector : (½ºÅ¸ÀÏ ¼±ÅÃÀÚ)
¼Ó¼ºÀ» °¡Áú¼ö ÀÖ´Â ¿¤·¹¸àÆ®()³ª Ŭ¶ó½º(class) À̸§ ȤÀº ÀνÄÀÚ(id)ÀÌ´Ù.

: (¼Ó¼º ¹®ÀÚ¿­)
½ºÅ¸ÀÏ ¼Ó¼ºÀº °³Ã¼ÀÇ °¢ top, right, bottom, left ÆíÀÇ ¸¶ÁøÀÇ ³Êºñ¸¦ ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

(À§ÂÊ) marginTop ¼Ó¼ºÀÇ À¯È¿ÇÑ ¹üÀ§ÀÇ ¸¶Áø ³ÊºñÀÇ °ªÀÌ´Ù.
(¿À¸¥ÂÊ) marginRight ¼Ó¼ºÀÇ À¯È¿ÇÑ ¹üÀ§ÀÇ ¸¶Áø ³ÊºñÀÇ °ªÀÌ´Ù.
(¾Æ·¡ÂÊ) marginBottom ¼Ó¼ºÀÇ À¯È¿ÇÑ ¹üÀ§ÀÇ ¸¶Áø ³ÊºñÀÇ °ªÀÌ´Ù.
(¿ÞÂÊ) marginLeft ¼Ó¼ºÀÇ À¯È¿ÇÑ ¹üÀ§ÀÇ ¸¶Áø ³ÊºñÀÇ °ªÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº currentStyle¿¡¼­´Â ÀбâÀü¿ëÀÌ°í, ±×¿ÜÀÇ °³Ã¼¿¡¼­´Â Àбâ/¾²±âÀ̸ç, µðÆúÆ®°ªÀº 0 0ÀÌ´Ù.

CSS(Cascading Style Sheets) ¾ÖÆ®¸®ºäÆ®´Â »ó¼ÓµÇÁö ¾Ê´Â´Ù.

Ư±â

ÀÌ ¼Ó¼ºÀº ³×°¡Áö °ªÀ» Çѹø¿¡ ¼³Á¤Çϰųª ¹ÝȯÇÒ ¼ö ÀÖ´Â º¹ÇÕ Ãà¾à ¼Ó¼ºÀÌ´Ù.
³×°¡Áö ¼Ó¼ºÀÇ ¼ø¼­´Â top, right, botttom, leftÀÌ´Ù.

IE4.0¿¡¼­, ±Û²ÃÀÇ ³ôÀÌ¿¡ »ó´ëÀûÀÎ ±æÀÌ°ª em, ȤÀº 'x' ±ÛÀÚ ³ôÀÌ¿¡ »ó´ëÀûÀÎ ±æÀÌ°ª exÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.

IE3.0¿¡¼­, ÁöÁ¤µÈ ¸¶Áø°«ÀÌ °³Ã¼ÀÇ µðÆúÆ®°ª¿¡ ´õÇØÁ³¾ú´Ù. IE4.0 ÀÌÈÄ ¸¶Áø°ªÀº Àý´ë°ªÀÌ´Ù. IE4.0¿¡¼­ ¸¶Áø ¼Ó¼ºÀº td¿Í tr °³Ã¼¿¡¼­´Â ÀÛ¿ëÇÏÁö ¾ÊÁö¸¸ IE3.0¿¡¼­´Â ÀÛµ¿Çß¾ú´Ù. IE4.0 ÀÌÈÄ¿¡¼­ °³Ã¼¿¡ Àû¿ëÇÏ·Á¸é td °³Ã¼ ¼Ó¿¡¼­ divÀ̳ª pµî °³Ã¼¿¡ marginÀ» Àû¿ëÇÏ¸é µÈ´Ù.

IE5.5¿¡¼­´Â, ÀÌ ¼Ó¼ºÀÌ ÀζóÀÎ ¿¤·¹¸àÆ®¿¡µµ Àû¿ëµÈ´Ù. ÀÌÀü ¹öÀü¿¡¼­´Â ÀζóÀÎ ¿¤·¹¸àÆ®´Â position ¼Ó¼º°ªÀÌ absoluteÀ̰ųª ÀÌ ¼Ó¼ºÀ» ÀÌ¿ëÇÏ¿© ¹èÄ¡µÇ¾î¾ß ÇÑ´Ù. height³ª width ¼Ó¼ºÀÇ ¼³Á¤µÈ °ª¿¡ ÀÇÇÏ¿© ¿¤·¹¸àÆ®ÀÇ ¹èÄ¡°¡ °áÁ¤µÈ´Ù.

ÀζóÀÎ ¿¤·¹¸àÆ®¿¡¼­ top°ú bottom °ªÀº ÁÖÀ§ ÀζóÀÎ ¿¤·¹¸àÆ®ÀÇ Å׵θ®(border) Áö¿ªÀ» °è»ê¿¡ »ç¿ëµÈ´Ù. ÀÌ °ªÀº ¶óÀÎÀÇ ³ôÀÌ¿¡ Âü¿©ÇÏÁö ¾Ê´Â´Ù.

¸¶Áø(margin) Áö¿ªÀº Ç×»ó Åõ¸íÇÏ´Ù.

Àû¿ë
°³Ã¼scriptCSS IE ¹öÀü
ÂüÁ¶
CSS ±æÀÌ´ÜÀ§ margin marginTop marginBottom marginLeft marginRight

ÀÌ ¼Ó¼ºÀº CSS1(Cascading Style Sheets, Level 1)¿¡¼­ Á¤ÀǵǾú´Ù.


°á°ú Ç¥½Ãâ

³ë¶õ»ö ºÎºÐÀÌ margin Áö¿ªÀÌ´Ù. À̹ÌÁö À§¿¡ ¸¶¿ì½º¸¦ ¿Ã·Áº¸¶ó.

<SCRIPT>
function showAll(){
  str='img1Obj.style.margin='+img1Obj.style.margin+'<BR>';
  str+='img2Obj.style.margin='+img2Obj.style.margin+'<BR>';
  showA.innerHTML=str;
}
</SCRIPT>
<TABLE height=250 width=600>
<TR>
<TD>
<DIV style="border:solid 1 blue;background-color:ffa;width:1">
<IMG id="img1Obj" src="../../gif/flower.jpg" width="200" style="margin:10 20 30 40"
  onmouseover="this.style.margin='40 30 20 10';showAll()" onmouseout="this.style.margin='10 20 30 40';showAll()">
</DIV>
</TD>
<TD>
<DIV style="border:solid 1 blue;background-color:ffa;width:1">
<IMG id="img2Obj" src="../../gif/flower1.jpg" width="200" style="margin:10 40"
  onmouseover="this.style.margin='40 10';showAll()" onmouseout="this.style.margin='10 40';showAll()">
</DIV>
</TD>
</TR>
</TABLE>
<DIV id=showA>°á°ú Ç¥½Ãâ</DIV>