【发布时间】:2019-12-31 02:07:35
【问题描述】:
根据谷歌人的评论here
box-orient(及其 webkit 变体)是旧版本的 flexbox 规范遗留下来的非标准属性。它的任何错误都可能与此有关。
所以在下面的代码中我想删除以下样式display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
并用新的 flexbox 规范替换它们,我怎样才能做到这一点,期望的结果是在演示中将线夹在 2 行长度(文本溢出到省略号)
<div style="min-height: 128px;
border-radius: 7px;
box-shadow: 0 2px 4px 0 rgba(210, 210, 210, 0.5);
border: solid 0.3px rgba(26, 25, 25, 0.15);
background-color: #ffffff;
width: 268px;
margin-bottom: 13px;">
<div style="overflow: hidden;
text-overflow: ellipsis;
padding-top: 5.6px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;">
Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’? Can we make
this upper case? and also remove the word and’? Can we make this upper case? and also remove the word and’?
</div>
</div>
注意:这个改变的原因是当这个Github issue提到的html元素默认隐藏时这个样式不起作用。工作 Angular 演示 here
【问题讨论】:
标签: javascript html css angular flexbox