Line-clamped text with ellipsis without pseudo elements
HTML
<input id="eee" type="checkbox">
<p class="container">
But more text here (the same markup structure though):
<img src="http://php.ru/forum/download/file.php?avatar=23761_1428045648.gif">
if the text overflows from the clamped paragraph's height, the ellipse will show.
<label for="eee" class="showMore"><nobr>Show more</nobr></label>
</p>
CSS
.container {
line-height: 20px;
overflow: hidden;
max-height: 105px;
position: relative;
}
img {
float: left;
padding: 5px;
}
.container:before {
content: attr(my-text);
}
.showMore {
position: absolute;
right: 0;
bottom: 0;
background-color: #fff;
display: block;
top: 88px;
width: 100%;
text-align: right;
text-decoration: underline;
cursor: pointer;
color: blue;
}
[type="checkbox"]:checked + p {
max-height: 100%;
}
[type="checkbox"]:checked + p>.showMore {
top: 9999px;
}