Created
May 5, 2015 12:43
-
-
Save nternetinspired/ca8a3092208d945f7d43 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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 class="hero"> | |
| <div class="hero-overlay center">Centred Content</div> | |
| <div class="hero-image"> | |
| <img src="http://placehold.it/600x400"> | |
| </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 characters
| // ---- | |
| // Sass (v3.4.13) | |
| // Compass (v1.0.3) | |
| // ---- | |
| // Displays big text, on a colored background, with padding. | |
| .hero { | |
| position: relative; | |
| z-index: 1; | |
| &-image { | |
| background-size: cover; | |
| background-position: 50% 50%; | |
| background-repeat: no-repeat; | |
| width: 100%; | |
| img { | |
| width: 100%; | |
| } | |
| } | |
| } | |
| // Vertically and horizontally center thing of unknown size inside and parent of unknown size. | |
| .center { | |
| margin-top: 0; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: 100%; | |
| text-align: center; | |
| transform: translate(-50%, -50%); | |
| } |
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
| .hero { | |
| position: relative; | |
| z-index: 1; | |
| } | |
| .hero-image { | |
| background-size: cover; | |
| background-position: 50% 50%; | |
| background-repeat: no-repeat; | |
| width: 100%; | |
| } | |
| .hero-image img { | |
| width: 100%; | |
| } | |
| .center { | |
| margin-top: 0; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: 100%; | |
| text-align: center; | |
| transform: translate(-50%, -50%); | |
| } |
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 class="hero"> | |
| <div class="hero-overlay center">Centred Content</div> | |
| <div class="hero-image"> | |
| <img src="http://placehold.it/600x400"> | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment