def truncate(len)
return "#{self[0...len]}... " if self.length > len
self
end
.block {
height: 150px;
background-color: orange;
-webkit-columns: 2 auto;
-moz-columns: 2 auto;
columns: 2 auto;
}
.item {
margin-top: 0px;
background-color: green;
height: 40px;
width:100%;
display:inline-block;
}
<div class='parent'>
<span class='child1'>1</span>
<span class='child2'>2</span>
</div>
.child1 {
display: block;
}
.child2 {
display: none;
}
.parent:hover .child1 {
display: none;
}
.parent:hover .child2 {
display: block;
}