top, left, bottom, right Property
top, left, bottom, right Property
ÀÌ PropertyµéÀº ÀÚ½ÅÀÌ ´ã°ÜÀÖ´Â Box ¼Ó¿¡¼ÀÇ top, left, bottom, right¿¡¼ÀÇ °Å¸®¸¦ ÁöÁ¤ÇÏ´Â Propertyµé ÀÔ´Ï´Ù. body Tag¿¡ Á÷Á¢ ÁöÁ¤Çϸé top, left¸¸ ÀÛµ¿Çϰí bottom, right´Â ÀÛµ¿ÇÏÁö ¾Ê½À´Ï´Ù. ÇÏÁö¸¸ body°¡ ¾Æ´Ñ DIV°°Àº Box ¼Ó¿¡ ´ã°ÜÀÖ´Â ¹°Ã¼ÀÏ °æ¿ì top, left, bottom, right ¸ðµÎ ÀÛµ¿Çϸç, length¿Í percentage ¸ðµÎ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
[Ç¥ º¸´Â ¹æ¹ý]
| top, right, bottom, left Property |
| Value |
<length
> | <percentage
> | auto | Inherit |
| Initial |
auto |
| Applies to |
positioned elements |
| Inherited |
no |
| Percentages |
refer to height of containing block |
| Media |
Visual |
| HTML Syntax |
{ top: sTop } |
| Scripting |
object.style.top [ = sTop ] |
CSS Scripting
onMouseOver="this.style.top='50px';"
¾Æ·¡ÀÇ ¿¹Á¦´Â °¡·Î, ¼¼·Î 100pixel Å©±âÀÇ Box¸¦ widht 100%, height 400pixel Å©±âÀÇ DIV Box ¼Ó¿¡ ³Ö°í top, left, bottom, right¸¦ °¢°¢ 50pixel ¾¿ ¶ç¿î ¿¹Á¦ÀÔ´Ï´Ù.
Ãâ·Â°á°ú
bottom:50px; right:50px;
top:50px; right:50px;
bottom:50px; left:50px;
top:50px; left:50px;
¼Ò½º º¸±â
ÀÔ·Â
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE type="text/css">
<!--
.side{
position:absolute;
border:1px solid #333333;
width:100px;height:100px;
text-align:center;
}
.output{
width:100%;
background:#dfdfdf;
font:11px/1.6em Verdana;
padding:10px;
text-align:justify;
}
-->
</STYLE>
</HEAD>
<BODY>
<DIV class="output" style="height:400px;position:relative;">
<DIV class="side" style="bottom:50px; right:50px; background-color:palegreen;">
bottom:50px; right:50px;
</DIV>
<DIV class="side" style="top:50px; right:50px;background-color:gold;">
top:50px; right:50px;
</DIV>
<DIV class="side" style="bottom:50px; left:50px;background-color:tomato;">
bottom:50px; left:50px;
</DIV>
<DIV class="side" style="top:50px; left:50px;background-color:royalblue;">
top:50px; left:50px;
</DIV>
</DIV>
</BODY>
</HTML>
ÀÌ ¹®¼ÀÇ ÀúÀÛ±ÇÀº www.cadvance.org ¿¡ ÀÖ½À´Ï´Ù.
|