°³Ã¼ÀÇ °è»êµÈ ³Êºñ¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
(Á¤¼ö°ª) | °³Ã¼ÀÇ ³Êºñ¸¦ Çȼ¿´ÜÀ§·Î ³ªÅ¸³½´Ù. |
(¹éºÐÀ²) | °³Ã¼ÀÇ ³Êºñ¸¦ ¸ðüÀÇ ³Êºñ¿¡ ´ëÇÑ »ó´ëÀûÀÎ ¹éºÐÀ²·Î ³ªÅ¸³½´Ù. |
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
img °³Ã¼¿¡ width³ª height ¼Ó¼ºÀÌ ÇÑ°¡Áö¸¸ ÁöÁ¤µÇ¸é, img´Â ÁöÁ¤µÈ width³ª height¿Í ¿ø·¡ ÆÄÀÏÀÇ ½ÇÁ¦ Çȼ¿´ÜÀ§ ³Êºñ³ª ³ôÀÌ¿¡ ºñ·ÊÇÏ¿© ÁöÁ¤ÇÏ´Ï ¾ÊÀº ¼Ó¼º ³ôÀ̳ª ³Êºñ¸¦ ÀÚµ¿ÀûÀ¸·Î °áÁ¤ÇÑ´Ù.
°æ¿ì | ¿øº» ÆÄÀÏÀÇ À̹ÌÁö Å©±â(Çȼ¿) | 100*50 (W*H) | 100*200 (W*H) | 100*50 (W*H) |
---|---|---|---|---|
ÁöÁ¤µÈ À̹ÌÁö ³Êºñ | 20mm | 20mm | ÁöÁ¤¾øÀ½ | |
ÁöÁ¤µÈ À̹ÌÁö ³ôÀÌ | ÁöÁ¤¾øÀ½ | ÁöÁ¤¾øÀ½ | 20px | |
°á°ú | °á°ú À̹ÌÁö ³Êºñ | 20mm | 20mm | 40px ((100/50) * 20px) |
°á°ú À̹ÌÁö ³ôÀÌ | 10mm ((50/100) * 20mm) | 40mm ((200/100) * 20mm) | 20px |
img °³Ã¼¿¡ width³ª height ¼Ó¼ºÀ» ÀÚÁ¤ÇÏ°í ¿øº» À̹ÌÁö ÆÄÀÏÀÇ ³Êºñ¿Í ³ôÀÌ°¡ °°À¸¸é, °á°ú À̹ÌÁöÀÇ ³Êºñ¿Í ³ôÀ̵µ °°´Ù.
img °³Ã¼¿¡ width¿Í height ¼Ó¼ºÀ» ¸ðµÎ ÁöÁ¤Çϸé, À̹ÌÁöÀÇ ³Êºñ¿Í ³ôÀÌ´Â °Á¦ÀûÀ¸·Î ÁöÁ¤µÈ °Íµé°ú °°ÀÌµÇ¾î ¿øº»°ú ´Ù¸¥ ºñÀ²À̵Ǿî Ç¥ÇöµÈ´Ù.
¹éºÐÀ²·Î ÁöÁ¤ÇÏ¸é ³Êºñ¿Í ³ôÀÌ´Â ¸ðü °³Ã¼ÀÇ ³Êºñ³ª ³ôÀÌ¿¡ ´ëÇÑ ºñÀ²·Î °è»êÇÏ¿© Ç¥ÇöÇÒ ¼ö ÀÖÁö¸¸, ÀÌ ¼Ó¼ºÀº Ç×»ó Çȼ¿´ÜÀ§ÀÌ´Ù.
pixelWidth³ª posHeight ¼Ó¼ºÀ» »ç¿ëÇÏ¿© width, height ¼Ó¼ºÀ» ½ºÆ®¸³Æ®·Î ÁöÁ¤ÇÏ¸é ¼öÄ¡ÀûÀ¸·Î °è»êµÇ¾î Ç¥ÇöµÈ´Ù.
³ôÀÌ¿Í ³Êºñ¸¦ ź·ÂÀûÀ¸·Î º¯°æÇÏ·Á¸é ¿øº» °ªµéÀ» width¿Í height ¾ÖÆ®¸®ºäÆ®·Î ¼³Á¤ÇÏ´Â ´ë½Å ½ºÅ¸ÀÏ·Î ÁöÁ¤ÇÏ¿©¾ß ÇÑ´Ù.(¿¹: style="height:200;width:200;")
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
ÀÌ ¼Ó¼ºÀº HTML 4.0¿Í (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
<IMG id="imgObj" src="../../gif/flower.jpg" width="200"><BR> <BUTTON onClick="imgObj.width='100';showA.innerText=imgObj.width">width=100</BUTTON> <BUTTON onClick="imgObj.width='200';showA.innerText=imgObj.width">width=200</BUTTON> <BUTTON onClick="imgObj.width='300';showA.innerText=imgObj.width">width=300</BUTTON> <DIV>imgObj.width=<SPAN id=showA><SCRIPT>document.write(imgObj.width=200)</SCRIPT></SPAN></DIV>
Ä 11 |
Ä 12 |
Ä 21 | Ä 22 |
°á°ú | .width | .height | .style.width | .style.height |
---|
<TABLE id="tableObj" width="90%" height="100" style="width:90%;height:100" border="1" bgcolor="#ffffdd"> <TR> <TD id="td11Obj" width="90%" height="80%" style="width:90%;height:80%"> <MARQUEE id="marqueeObj" width="90%" height="20" style="border:solid 1 blue;width:90%;height:20"> <IMG id="img1Obj" src="../../gif/rfexample.gif" width="50" height="18" style="width:50;height:18"> </MARQUEE><BR> Ä 11 </TD> <TD id="td12Obj" width="20%" style="width:20%"> <IMG src="../../gif/rfexample.gif" width="50" height="18"><BR>Ä 12</TD> </TR> <TR> <TD id="td21Obj" height="20%" style="height:20%">Ä 21</TD> <TD id="td22Obj">Ä 22</TD> </TR> </TABLE><BR> <TABLE border=1 width=90%> <TR> <TH>°á°ú</TH> <TH>.width</TH> <TH>.height</TH> <TH>.style.width</TH> <TH>.style.height</TH> </TR> <COL style="color:navy;font-weight:bold;background-color:eee"> <SCRIPT> str='<TR><TD>tableObj</TD><TD>'+tableObj.width+'</TD><TD>'+tableObj.height+'</TD>'; str+='<TD>'+tableObj.style.width+'</TD><TD>'+tableObj.style.height+'</TD></TR>'; str+='<TR><TD>td11Obj</TD><TD>'+td11Obj.width+'</TD><TD>'+td11Obj.height+'</TD>'; str+='<TD>'+td11Obj.style.width+'</TD><TD>'+td11Obj.style.height+'</TD></TR>'; str+='<TR><TD>td12Obj</TD><TD>'+td12Obj.width+'</TD><TD>'+td12Obj.height+'</TD>'; str+='<TD>'+td12Obj.style.width+'</TD><TD>'+td12Obj.style.height+'</TD></TR>'; str+='<TR><TD>td21Obj</TD><TD>'+td21Obj.width+'</TD><TD>'+td21Obj.height+'</TD>'; str+='<TD>'+td21Obj.style.width+'</TD><TD>'+td21Obj.style.height+'</TD></TR>'; str+='<TR><TD>td22Obj</TD><TD>'+td22Obj.width+'</TD><TD>'+td22Obj.height+'</TD>'; str+='<TD>'+td22Obj.style.width+'</TD><TD>'+td22Obj.style.height+'</TD></TR>'; str+='<TR><TD>marqueeObj</TD><TD>'+marqueeObj.width+'</TD><TD>'+marqueeObj.height+'</TD>'; str+='<TD>'+marqueeObj.style.width+'</TD><TD>'+marqueeObj.style.height+'</TD></TR>'; str+='<TR><TD>img1Obj</TD><TD>'+img1Obj.width+'</TD><TD>'+img1Obj.height+'</TD>'; str+='<TD>'+img1Obj.style.width+'</TD><TD>'+img1Obj.style.height+'</TD></TR>'; document.write(str); </SCRIPT> </TABLE>