HTML
<div class="container">
<div class="item">
many words in this div are showed in many lines
</div>
<div class="item this-item-shifted-down">
one line
</div>
<div class="item">
many words in this div are showed in many lines
</div>
<div class="item">
many words in this div are showed in many lines
</div>
<div class="item">
many words in this div are showed in many lines
</div>
<div class="item">
many words in this div are showed in many lines
</div>
<div class="item">
many words in this div are showed in many lines
</div>
</div>
and CSS
.item {
height:100px;
width:100px;
background:pink;
margin:5px;
display:inline-block;
white-space:normal;
}
.container {
white-space:nowrap;
}
There is a container, which contains many items, that should be displayed in one line with ability to go beyond the borders of container.
When I use white-space:nowrap;
for container and white-space:normal
for items, items are aligned to the bottom line.
How to align items to the top instead of bottom line of text and save ability to go beyoun the borders? Is this can be achieved without JavaScript
? I've found some similar questions at stackoverflow, but they don't solve my problem.