固定位置

1482 ワード



    
        
        
        
        <style type="text/css">
            
            .box1{
                width: 200px;
                height: 200px;
                background-color: red;
            }
            .box2{
                width: 200px;
                height: 200px;
                background-color: yellow;
                /*
                 *     position    fixed ,           
                 *              ,               
                 *     :
                 *                          
                 *                       ,        
                 * 
                 * IE6       
                 */
                position: fixed;
                
                left: 0px;
                top: 0px;
                
            }
            .box3{
                width: 200px;
                height: 200px;
                background-color: yellowgreen;
            }
            
        </style>
        
    
    
        
        <div class="box1"/>
        <div class="box4" style="width: 300px; height: 300px; background-color: orange; position: relative;">
            <div class="box2"/>
        </div>
        
        <div class="box3"/>
    


</code></pre> 
</article>
                            </div>
                        </div>