CSS 常用代码锦囊
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 
 | .textOverflow3 {overflow: hidden;
 position: relative;
 line-height: 1.5em;
 max-height: 4.5em;
 text-align: justify;
 margin-right: -1em;
 padding-right: 1em;
 &:before {
 background: #000;
 content: '...';
 padding: 0 1px;
 position: absolute;
 right: 14px;
 bottom: 0;
 }
 &:after {
 background: white;
 content: '';
 margin-top: 0.2em;
 position: absolute;
 right: 14px;
 width: 1em;
 height: 1em;
 }
 }
 
 | 
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 
 | .textoverflow a {display:block;
 width:120px;
 margin: 0px 0px 0px 3px;
 white-space: nowrap;
 overflow: hidden;
 float: left;
 -o-text-overflow: ellipsis;
 text-overflow: ellipsis;
 }
 .textoverflow:after{ content: "..."; }
 @media all and (min-width: 0px){ .textoverflow:after{ content:""; } }
 
 | 
使用css3来创建多栏,它可以自适应网页,不兼容IE
| 12
 3
 4
 5
 6
 7
 8
 9
 
 | #columns-3 {text-align: justify;
 -moz-column-count: 3;
 -moz-column-gap: 12px;
 -moz-column-rule: 1px solid #c4c8cc;
 -webkit-column-count: 3;
 -webkit-column-gap: 12px;
 -webkit-column-rule: 1px solid #c4c8cc;
 }
 
 | 
See the Pen 2048 game by Cam Song (@camsong) on CodePen.
---
        
            
        
        
          
              原文链接: http://blog.jajabjbj.top/2018/05/22/2018-05-22-1/
              版权声明: 转载请注明出处.