The following small series for you to share Table-cell completion of the left fixed width of the right fixed width and width and so on the layout of the implementation method. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
Use Table-cell to complete the following layouts (IE8 and above)
1. Left Fixed width-right adaptive
. left{ width:300px; height:500px; BORDER:1PX solid; Float:left; } . right{ width:10000px; height:500px; Display:table-cell; border:1px solid; } </style><p class= "left" ></p><p class= "right" >lorem ipsum dolor sit amet, consectetur Adipisicing elit. Beatae dolore est et itaque nesciunt nobis officia omnis optio similique vitae. Cupiditate eum exercitationem harum ID iusto maiores quaerat reprehenderit Sint. </p>
The effect is as follows:
(Resize the window to test whether the right side changes depending on the window size)
2. Right fixed width-left adaptive
<style> . right{ width:200px; height:500px; BORDER:1PX solid; Display:table-cell; } . left{ height:500px; BORDER:1PX solid; Display:table-cell; } . parent{ display:table; table-layout:fixed; width:100%; } </style><p class= "Parent" > <p class= "left" > Lorem ipsum dolor sit amet, consectetur Adipisicing elit. Amet Aperiam, Assumenda Dolores Eaque, Fugiat Illo, in Inventore itaque Magni nemo nisi nulla obcaecati quaerat totam unde Voluptatem Voluptatum. Amet, Totam. </p> <p class= "right" ></p></p>
The effect is as follows:
And the left side of the fixed width slightly different, although only a fixed width of the position to change, but can not directly use the floating like the left width of the way to complete.
3, about fixed width-intermediate adaptive
xml/html Code copy content to clipboard
<style> . parent{ display:table; table-layout:fixed; width:100%; } p{ border:1px solid; } . left,.right,.center{ Display:table-cell; } . left{ width:100px; height:200px; } . right{ width:100px; height:200px; } </style> <p class= "parent" > <p class= "left" ></p> <p class= "center" > Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias amet delectus ducimus ea Eos eum, Libero Modi quia, Soluta temporibus unde, ut. Aliquam, Dolorem ipsam porro quae quisquam saepe vitae! </p> <p class= "right" ></p></p>
The effect is as follows: