- 每种字体的默认行高不同,字体设计师会在字体文件中设置
- 文字在行尾中断转下行——word-break: break-all
- 单行文字溢出省略
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- 两行非连续文字两端对齐:
<!DOCTYPE html>
image.png
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style>
.father{
font-size:20px;
border:1px solid;
text-align:justify;
}
span{
display:inline-block;
border:1px solid transparent;
width:5em;
height:25px;
overflow:hidden;
}
span::after{
content:"";
display:inline-block;
width:100%;
border:5px solid blue;
}
</style>
</head>
<body>
<div class="father">
<span>姓名</span>
<span>联系方式</span>
</div>
</body>
</html>
网友评论