如何用DIV+CSS布局例子

2025-04-08 15:04:10
推荐回答(1个)
回答1:

举例(两列布局):



 
    
        
        练习使用HTML
        
    
 
    
        
        
            DIV
        

        
            DIV
        

        
            DIV
        

    
 

css代码:

css文件:

#d1{
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: red;
}
#d2{
    position: absolute;
    margin-left: 100px;
    width: 500px;
    height: 100px;
    background-color: blue;
}
#d3{
    position: absolute;
    margin-top: 100px;
    width: 600px;
    height: 100px;
    background-color: yellow;
}

效果:


相关问答
最新问答