CSS0026: div 内 多元素 水平 垂直 均匀 居中 显示 span 元素文字不超出边界
1,
<div class="feature"> <div class="like-wrap"> </div> <div class="empty-wrap"></div> <div class="share-wrap"> </div> </div>
2,
.feature { width: 4vh; height: 50%; position: absolute; right: 0; top: 0; z-index: 10; /* 垂直并排居中显示 */ display: flex; flex-direction: column; justify-content: center; /* 水平并排均匀显示 */ display: flex; flex-direction: row; justify-content: space-around; } .like-wrap, .empty-wrap, .share-wrap{ width: 4vh; height: 4vh; margin: 0.5vh 0; display: block; position: relative; border: 1px solid rgba(255, 255, 255, 0); }
3,span 元素 文字 不超出边界
#keyboard .jpskin { float: left; position: relative; padding-left: 5px; /* cursor: pointer; */ font-size: 1.1em; width: 180px; height: 48px; /* background-color: #333333; */ white-space:nowrap;/*强制单行显示*/ /*超出部分省略号表示*/ /* text-overflow:ellipsis; */ overflow:hidden;/*超出部分隐藏*/ /* 设置显示的最大宽度 */ /* width: 180px; */ text-align: left; }
琥珀君的博客