Created
April 15, 2015 08:48
-
-
Save airen/599f5d4cbe6d8d108eda 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="wrap"> | |
<div class="one">我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国</div> | |
<div class="more">我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国</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.12) | |
// Compass (v1.0.3) | |
// ---- | |
/// 控制文字行数溢出点点点 | |
/// @param {[string]} $v [1] 默认一行对于点点点结束 | |
/// @link http://gitlab.alibaba-inc.com/mtb/browser-designer/raw/dev/index.html?u=1256 | |
@mixin boxClamp($v:1){ | |
overflow:hidden; | |
-webkit-line-clamp: $v; | |
line-clamp: $v; | |
-webkit-box-orient: vertical; | |
box-orient: vertical; | |
display:-webkit-box; | |
display:box; | |
} | |
.wrap { | |
width: 300px; | |
border: 1px solid; | |
padding: 5px; | |
div { | |
margin: 5px; | |
} | |
} | |
.one { | |
@include boxClamp; | |
} | |
.more{ | |
@include boxClamp(2); | |
} |
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
.wrap { | |
width: 300px; | |
border: 1px solid; | |
padding: 5px; | |
} | |
.wrap div { | |
margin: 5px; | |
} | |
.one { | |
overflow: hidden; | |
-webkit-line-clamp: 1; | |
line-clamp: 1; | |
-webkit-box-orient: vertical; | |
box-orient: vertical; | |
display: -webkit-box; | |
display: box; | |
} | |
.more { | |
overflow: hidden; | |
-webkit-line-clamp: 2; | |
line-clamp: 2; | |
-webkit-box-orient: vertical; | |
box-orient: vertical; | |
display: -webkit-box; | |
display: box; | |
} |
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="wrap"> | |
<div class="one">我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国</div> | |
<div class="more">我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国我的中国</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment