So I have the following Fiddle that has set an ellipsis in a text into two lines. Then I want to have a 'More' link inline with the text.
http://jsfiddle.net/csYjC/2876/
So if our text has more than two lines, it should look like this:
That's correct. However:
That's not correct (should be inline with the text).
Code is like follows:
<div class="text">
<div>Lorem ipsum dolor sit amet, Lorem Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem Lorem i</div>
<a href="#">More</a>
</div>
And the css:
.text{
display: inline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
line-height: 24px; /* fallback */
max-height: 48px; /* fallback */
-webkit-line-clamp: 2; /* number of lines to show */
-webkit-box-orient: vertical;
}
.text a {
position: absolute;
}
I guess must be easy... Thank you in advance.
The div inside of .text
is still being displayed as a block element. Use this to fix:
.text > div { display: inline; }