Created
October 28, 2013 18:02
Revisions
-
jklm313 revised this gist
Oct 28, 2013 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,13 +17,12 @@ html { display: inline-block; vertical-align: top; text-align: left; margin-right: -4px; /* css-tricks.com/fighting-the-space-between-inline-block-elements/ */ } .main-col { width: 50%; /* whatever you want it to be but keep in mind that this + right-col's width sums up the container's width so if you give this 60% width and right-col 50%, you'll have to deal with horizontal scrollbars */ margin-left: 20%;/* equal to right-col's width */ /*demo purposes*/ background-color: white; @@ -33,7 +32,6 @@ html { .right-col { width: 20%; /* demo purposes */ background: dodgerblue; -
jklm313 created this gist
Oct 28, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ * { margin: 0; padding: 0; position: relative; box-sizing: border-box; } html { background-color: grey; } .container { text-align: center; } .main-col, .right-col { display: inline-block; vertical-align: top; text-align: left; } .main-col { width: 50%; /* whatever you want it to be but keep in mind that this + right-col's width sums up the container's width so if you give this 60% width and right-col 50%, you'll have to deal with horizontal scrollbars */ /* you need only specify negative margin for this column since right-col already has margin-right specified */ margin-right: -4px; /* css-tricks.com/fighting-the-space-between-inline-block-elements/ */ /*demo purposes*/ background-color: white; border: 3px dashed; min-height: 600px; } .right-col { width: 20%; margin-right: -20%; /* same as its width */ /* demo purposes */ background: dodgerblue; min-height: 300px; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ <div class='container'> <div class='main-col'></div> <div class='right-col'></div> </div> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ // alert('Hello world!'); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ {"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}