Normal flow<HTML> <HEAD> <STYLE type="text/css"> BODY {line-height: 250%} </STYLE> </HEAD> <BODY> <P>¿©±â¼ºÎÅÍ º»¹®ÀÌ ½ÃÀÛÇÕ´Ï´Ù. <SPAN id=outer>¿©±â´Â outer¿¡ ÇØ´çÇÏ´Â ³»¿ëÀÌ ½ÃÀÛÇÏ´Â °÷ÀÔ´Ï´Ù. <SPAN id=inner>ÀÌ°÷Àº InnerÀÇ ³»¿ëÀÌ µé¾î°¡Áö¿ä.</SPAN> ¿©±â±îÁö outerÀÇ ³»¿ëÀº ³¡ÀÔ´Ï´Ù.</SPAN> ±×¸®°í, º»¹®ÀÌ ³¡³µ½À´Ï´Ù. </P> </BODY> </HTML> ÀÌ·¸°Ô ³ª¿Í¿ä
#outer {color: red;} #inner {color: blue;} ÀÌ·¸°Ô ³ª¿Í¿ä
Relative positioning
BODY {line-height : 80%} #outer {position: relative; top: -12px; color: red;} #inner {position: relative; top: 12px; color: blue;} ÀÌ·¸°Ô ³ª¿Í¿ä
Floating
<HTML> <HEAD> <STYLE type="text/css"> BODY {line-height: 200%} #outer {color: red;} #inner {float: right; width: 130px; color: blue;} #sibling {clear: right; color: red;} </STYLE> </HEAD> <BODY> <P>¿©±â¼ºÎÅÍ º»¹®ÀÌ ½ÃÀÛÇÕ´Ï´Ù. <SPAN id=outer>¿©±â´Â outer¿¡ ÇØ´çÇÏ´Â ³»¿ëÀÌ ½ÃÀÛÇÏ´Â °÷ÀÔ´Ï´Ù. <SPAN id=inner>ÀÌ°÷Àº InnerÀÇ ³»¿ëÀÌ µé¾î°¡Áö¿ä.</SPAN> <SPAN id=sibling>ÀÌ°÷Àº SiblingÀÇ ³»¿ëÀÌ µé¾î°¡Áö¿ä.</SPAN> ¿©±â±îÁö outerÀÇ ³»¿ëÀº ³¡ÀÔ´Ï´Ù.</SPAN> ±×¸®°í, º»¹®ÀÌ ³¡³µ½À´Ï´Ù. </P> </BODY> </HTML> ÀÌ·¸°Ô ³ª¿Í¿ä
Absolute positioning
#outer {position: absolute; top: 150px; left: 150px; width: 200px; color: red;} #inner {color: blue;} ÀÌ·¸°Ô ³ª¿Í¿ä #outer {color: red;} #inner {position: absolute; top: 200px; left: -50px; width: 130px; color: blue;} ÀÌ·¸°Ô ³ª¿Í¿ä