请问怎么让这个text只占有文字的地方。我觉得应该是继承了父元素的宽度,怎么清除?浮动?
检查父级标签是否使用了flex布局,或text进行了display:block;。
flex
text
display:block;