Created
March 10, 2014 16:39
-
-
Save peterpme/9468635 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="container"> | |
<h3>Normal List:</h3> | |
<ul> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Inline List</h3> | |
<ul class="inline-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Inline-block list</h3> | |
<ul class="inline-block-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Block list</h3> | |
<ul class="block-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
</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.3.0) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// don't worry that it says SCSS (Sass) | |
// this is all basic CSS you can paste right back in | |
*, *:before, *:after { | |
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; | |
} | |
/* | |
inline | |
allowed: | |
elements to the left and right | |
(you can do text align with inline) | |
*/ | |
.inline-list > li{ | |
display:inline; | |
background:#eee; | |
padding:1em; | |
width:100px;// doesn't work | |
} | |
/* | |
inline-block | |
allowed: | |
TOP & BOTTOM MARGINS | |
SET WIDTHS | |
*/ | |
.inline-block-list > li{ | |
display:inline-block; | |
background:#eee; | |
padding:1em; | |
margin-top:1em; | |
width:100px; // works! | |
} | |
/* | |
block | |
forces a break between each element | |
*/ | |
.block-list > li{ | |
display:block; | |
background:#eee; | |
padding:1em; | |
margin-bottom:1em; | |
width:100px; | |
} |
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
*, *:before, *:after { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
/* | |
inline | |
allowed: | |
elements to the left and right | |
(you can do text align with inline) | |
*/ | |
.inline-list > li { | |
display: inline; | |
background: #eee; | |
padding: 1em; | |
width: 100px; | |
} | |
/* | |
inline-block | |
allowed: | |
TOP & BOTTOM MARGINS | |
SET WIDTHS | |
*/ | |
.inline-block-list > li { | |
display: inline-block; | |
background: #eee; | |
padding: 1em; | |
margin-top: 1em; | |
width: 100px; | |
} | |
/* | |
block | |
forces a break between each element | |
*/ | |
.block-list > li { | |
display: block; | |
background: #eee; | |
padding: 1em; | |
margin-bottom: 1em; | |
width: 100px; | |
} |
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="container"> | |
<h3>Normal List:</h3> | |
<ul> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Inline List</h3> | |
<ul class="inline-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Inline-block list</h3> | |
<ul class="inline-block-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Block list</h3> | |
<ul class="block-list"> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment