Last active
August 29, 2015 14:19
-
-
Save tow8ie/63974585933f29b3155a 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
%h3 Hover inner texts for debugging: | |
%p | |
Some text. | |
%span.container-1 | |
%span.child Inner text 1. | |
%span.child Inner text 2. | |
Some text. | |
%p | |
Some text. | |
%span.container-1 | |
%span.child Inner text 1. | |
%span.child | |
%input(type='text' placeholder='Placeholder text') | |
%span.child Inner text 2. | |
Some text. | |
%p | |
Some text. | |
%span.container-2 | |
%span.child Inner text 1. | |
%span.child Inner text 2. | |
Some text. | |
%p | |
Some text. | |
%span.container-2 | |
%span.child Inner text 1. | |
%span.child | |
%input(type='text' placeholder='Placeholder text') | |
%span.child Inner text 2. | |
Some text. | |
%p | |
%a(href='http://www.brunildo.org/test/inline-block.html') | |
Some more information for working with <code>display: inline-block</code>. |
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.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
$height: 50px; | |
.container { | |
line-height: $height; | |
height: $height; | |
display: inline-block; | |
vertical-align: middle; | |
} | |
// Well suited for pixel-perfect alignment | |
.container-1 { | |
@extend .container; | |
.child { | |
float: left; | |
} | |
} | |
// Well suited for text-like flow | |
.container-2 { | |
@extend .container; | |
.child { | |
display: inline-block; | |
height: $height; | |
line-height: $height; | |
} | |
} | |
// Debugging colors | |
.container-1, .container-2 { | |
background-color: pink; | |
} | |
.container-1:hover, .container-2:hover { | |
.child { | |
background-color: rgba(255, 255, 255, 0.5); | |
//opacity: 0.5; | |
} | |
} | |
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
.container, .container-1, .container-2 { | |
line-height: 50px; | |
height: 50px; | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.container-1 .child { | |
float: left; | |
} | |
.container-2 .child { | |
display: inline-block; | |
height: 50px; | |
line-height: 50px; | |
} | |
.container-1, .container-2 { | |
background-color: pink; | |
} | |
.container-1:hover .child, .container-2:hover .child { | |
background-color: rgba(255, 255, 255, 0.5); | |
} |
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
<h3>Hover inner texts for debugging:</h3> | |
<p> | |
Some text. | |
<span class='container-1'> | |
<span class='child'>Inner text 1.</span> | |
<span class='child'>Inner text 2.</span> | |
</span> | |
Some text. | |
</p> | |
<p> | |
Some text. | |
<span class='container-1'> | |
<span class='child'>Inner text 1.</span> | |
<span class='child'> | |
<input placeholder='Placeholder text' type='text'> | |
</span> | |
<span class='child'>Inner text 2.</span> | |
</span> | |
Some text. | |
</p> | |
<p> | |
Some text. | |
<span class='container-2'> | |
<span class='child'>Inner text 1.</span> | |
<span class='child'>Inner text 2.</span> | |
</span> | |
Some text. | |
</p> | |
<p> | |
Some text. | |
<span class='container-2'> | |
<span class='child'>Inner text 1.</span> | |
<span class='child'> | |
<input placeholder='Placeholder text' type='text'> | |
</span> | |
<span class='child'>Inner text 2.</span> | |
</span> | |
Some text. | |
</p> | |
<p> | |
<a href='http://www.brunildo.org/test/inline-block.html'> | |
Some more information for working with <code>display: inline-block</code>. | |
</a> | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment