Created
August 25, 2014 19:54
-
-
Save gunnarbittersmann/e304895b7f5ef03c6190 to your computer and use it in GitHub Desktop.
right edge of box at given distance from left viewport edge
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 characters
| /** | |
| * right edge of box at given distance from left viewport edge | |
| */ | |
| #a | |
| { | |
| position: absolute; | |
| top: 100px; | |
| right: 100%; | |
| transform: translateX(100px); | |
| } | |
| #b | |
| { | |
| position: absolute; | |
| top: 200px; | |
| left: 100px; | |
| transform: translateX(-100%); | |
| } | |
| #c | |
| { | |
| float: left; | |
| margin-top: 300px; | |
| margin-left: 100px; | |
| transform: translate(-100%); | |
| } | |
| #d | |
| { | |
| float: right; | |
| margin-top: calc(100px - 2.5em); | |
| margin-right: 100%; | |
| transform: translateX(100px); | |
| } | |
| div | |
| { | |
| padding: 0.5em 1em; | |
| background: #048; | |
| color: white; | |
| } | |
| html | |
| { | |
| background: linear-gradient(to right, white 99px, silver 99px, silver 100px, white 100px); | |
| font: 1em/1.5 "Helvetica Neue", Helvetica, sans-serif; | |
| } | |
| html, body | |
| { | |
| margin: 0; | |
| padding: 0; | |
| height: 100%; | |
| } |
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 characters
| <div id="a">a</div> | |
| <div id="b">b</div> | |
| <div id="c">c</div> | |
| <div id="d">d</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 characters
| // 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 characters
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment