img {
object-fit: cover;
object-position: center;
}
.image {
background: url() no-repeat center;
background-size: cover;
}
<div class="textfield" contentEditable="true">напиши-ка!
</div>
.textfield {
font-size:16px;
color:white;
min-height:16px;
line-height:20px;
width:200px;
border:1px solid #999;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACtJREFUeNpiNDY2ZiAXMDFQAEY1j2oe1TyoNLNoOu0nX/P1fY4D42yAAAMA7aYDxR1GwC8AAAAASUVORK5CYII=')
}
body {background:#333; font-family:Arial, sans-serif}
<textarea rows="1" cols="20" id="ta1" class="textfield">напиши-ка!
</textarea>
var ta1 = document.getElementById('ta1');
ta1.addEventListener('input', function(){
var rows = Math.ceil( ta1.scrollHeight / 20 ) - 1;
ta1.style.height = 20 * rows + 'px';
});
<label><span>текст</span><input></label>
label {display:flex;}
span {flex: 0 0 auto;}/*не меняет размеров*/
input {flex: 1 1 auto}/*занимает все оставшееся пространство и сжимается*/
echo date('r', 1493316022);
// Thu, 27 Apr 2017 18:00:22 +0000
date = new Date(1493316022 * 1000);
console.log(date.toString());
//Thu Apr 27 2017 21:00:22 GMT+0300 (MSK)
.day{$}*5