Created
March 2, 2015 12:31
-
-
Save co0kie/b4af107335cbd536cc50 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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="relative"> | |
relative | |
<div class="absolute"> | |
absolute | |
</div> | |
</div> | |
<div class="center-div"> | |
div centered with 500px width | |
</div> |
This file contains 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.3.14) | |
// Compass (v1.0.1) | |
// ---- | |
@import "compass"; | |
// body{width: 700px;margin: 0 auto;padding: 20px;} | |
.relative{ | |
position: relative; | |
width: 400px; | |
height: 100px; | |
border: 1px solid red; | |
.absolute{ | |
background: #000; | |
color: #fff; | |
width: 200px; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} | |
} | |
.center-div{ | |
width: 500px; | |
margin: 0 auto; | |
border: 1px solid red; | |
padding: 20px; | |
} |
This file contains 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
.relative { | |
position: relative; | |
width: 400px; | |
height: 100px; | |
border: 1px solid red; | |
} | |
.relative .absolute { | |
background: #000; | |
color: #fff; | |
width: 200px; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} | |
.center-div { | |
width: 500px; | |
margin: 0 auto; | |
border: 1px solid red; | |
padding: 20px; | |
} |
This file contains 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="relative"> | |
relative | |
<div class="absolute"> | |
absolute | |
</div> | |
</div> | |
<div class="center-div"> | |
div centered with 500px width | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment