项目中遇到的css问题
中台应用
span换行
1.span标签不换行导致
span{
position:relative;
top:10;
white-space:normal;
word-break:break-all;
color:#666
}
white-space:normal;
word-break:break-all;这两个属性是用来设置span标签换行的,但在这里并没有起作用。
后面设置display和line-height的属性即可。
span{
position:relative;
top:10;
white-space:normal;
word-break:break-all;
color:#666;
display:block;
line-height:15px;
}
超过一定的字数设为省略号
//一点要可以设置宽度的情况,当为span的时候要设置display:inline-block
<style type="text/css">
.text_slice {
width: 100px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>