<div>上海<span></span></div>
div {
width: 100px;
height: 50px;
background-color: pink;
margin: 0 auto;
text-align:justify;
text-align-last:justify;
}
div span {
display: inline-block;
width: 100%;
}
![](https://i-blog.csdnimg.cn/blog_migrate/cfdc4c7f7cb15b34113673811f5ba5ca.png)