|
position: relative top: 距離 bottom: 距離 left: 距離 right: 距離 |
←相対配置であることを示す ←上からの位置 ←下からの位置 ←左からの位置 ←右からの位置 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <META http-equiv="Content-Style-Type" content="text/css"> <TITLE>CSS覚書</TITLE> <STYLE type="text/css"> <!-- body { color: #ff6600; background: #ffffff } h2 { font: bold 60px arial, sans-serif; text-aligm: center; margin-bottom: 0; color: #99ccff; background: #ffffff } p { position: relative; top: -90px; font: bold 20px "MS Pゴシック",osaka,sans-serif; text-align: center; margin-top: 0; color: #000000; background-color: transparent } h1 { text-align: center; color: #ff6600 } --> </STYLE> </herd></HEAD> <body> <h1>相対的な位置に配置する</h1> <center> <H2>POSITION<br>RELATIVE</h2> <P>普通の配置位置から<br>相対的に移動します。</P> </body> </html> |