我有这个代码:
HTML:
<div class="tile"> <h3>short</h3> <div class="content">Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,sunt in culpa qui officia deserunt mollit anim id est laborum.</div> </div> <div class="tile"> <h3>longLongLong longLongLong longLongLong</h3> <div class="content">Lorem ipsum dolor sit amet,sunt in culpa qui officia deserunt mollit anim id est laborum.</div> </div>
CSS:
.tile{ height: 300px; width: 200px; background: #cecece; float: left; margin: 0 10px 0 0; } .tile h3{ min-height: 20px; max-height: 61px; display: inline-block; overflow: hidden; } .tile .content{ height: 162px; overflow: hidden; margin: 0 10px; }
小提琴:
我得到这个布局
但我需要得到像下一个图像,而不使用js。
可以解决吗