Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to split page into 4 equal parts?

Tags:

html

css

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 (<div>s) to be resized automatically (and relatively) if the browser window is resized.

I have not worked with CSS for a long time. I've no idea how to handle this.

like image 515
Santosh Kumar Avatar asked Sep 05 '12 14:09

Santosh Kumar


People also ask

How do I divide a page into 4 equal parts in Excel?

On the Table Tools | Layout tab, make sure that View Gridlines is turned on. By default, you get one divided page (a 2x2 table) and one runover page (with just a single empty paragraph. As you finish the fourth card and press Tab, a new row will be created (as in any table).

How do I split a page into 4 on publisher?

Was this reply helpful? Set up one instance of the layout that you want at the top of a page and then copy and paste it three times so that you have the four instances on the one page. Then print the page multiple times. Was this reply helpful?


1 Answers

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

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; }
<div id="div1"></div> <div id="div2"></div> <div id="div3"></div> <div id="div4"></div>
like image 97
Scott Brown Avatar answered Sep 20 '22 06:09

Scott Brown