PHP & JavaScript Room :: 設置サンプル

実行結果

100x100

ソース

<style type="text/css">
    div.grid {
        position:relative;
        width:200px; height:200px;
        margin:0; padding:0;
        background:#fff url(/content/img/css/grid.gif) repeat top left;
    }
    div.grid div.pos_top {
        position:absolute;
        top:20px; /* 親ボックスの上辺から下方向へ20pxの位置 */
        width:100px; height:100px;
    }
</style>

<div class="grid">
    <div class="pos_top"><img src="/content/img/100x100.gif" alt="100x100" width="100" height="100" /></div>
</div>

polarized women