How to split page into 4 equal parts?

后端 未结 6 1181
走了就别回头了
走了就别回头了 2020-12-14 06:37

I want to divide my page into four equal parts, each of same height and width (50-50%).

I don\'t want to use JavaScript. I want blocks (

6条回答
  •  孤城傲影
    2020-12-14 07:12

    HTML

    CSS

    html, body { height: 100%; padding: 0; margin: 0; }
    div { width: 50%; height: 50%; float: left; }
    #div1 { background: #DDD; }
    #div2 { background: #AAA; }
    #div3 { background: #777; }
    #div4 { background: #444; }
    

    Demo at http://jsfiddle.net/CRSVU/

提交回复
热议问题