Align inline elements aside without new line
DEMO
Live demo
HTML
<html>
<body>
<a href="#" class="foo">
<span>hello</span>
<span>xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx </span>
</a>
</body>
</html>
CSS
.foo {
width: 300px;
white-space: nowrap;
display: block;
vertical-align: top;
text-decoration: none;
border: 1px solid #ccc;
}
span {
display: inline-block;
white-space: normal;
vertical-align: top;
margin: 10px;
}
Written by Faz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#