-
-
Save teetteet/7359778 to your computer and use it in GitHub Desktop.
Revisions
-
teetteet revised this gist
Nov 7, 2013 . No changes.There are no files selected for viewing
-
giuseppeg created this gist
Nov 7, 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,49 @@ /** * Dead Center an element with display: inline-block */ html, body { margin: 0; height: 100%; } .container { letter-spacing: -0.31em; text-rendering: optimizespeed; text-align: center; height: 100%; } .container:before { content: ""; display: inline-block; vertical-align: middle; width: 5px; background-color: red; height: 100%; } .container > .content { box-sizing: border-box; display: inline-block; vertical-align: middle; letter-spacing: normal; text-rendering: auto; text-align: left; } /* useless fancyness */ body { background-color: #eee; } h1 { margin-top: 0; font-size: 1.2em; } .container > .content { width: 100%; max-width: 440px; border: 1px solid #ccc; padding: 20px; border-radius: 4px; box-shadow: 0 1px 2px #ccc; background-color: #fff; } 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,7 @@ <div class="container"> <div class="content"> <h1>Dead Center an element with display: inline-block</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam a nisl ut lacus adipiscing fringilla ut eget orci.</p> <a href="http://twitter.com/giuseppgurgone">@giuseppegurgone</a> </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":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}