Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

tag里面的字数不同。导致一行显示不完就掉下去了半边

tag里面的字数不同。
导致一行显示不完就掉下去了半边。
怎样去判断才能让它太长了就自动一起在下一行显示?
而不是拆分成2半呢?】
太丑了
如图:黄色背景部分就是tag标签:
image.png
代码:

<div class="issue-tags">  
 <router-link v-for="item in tags"  
 :key="item.topicId"  
 :to="{path:'/topicdetail',query:{topicId: item.topicId}}"  
 >  
 <span>{{ item.topicName }}</span>  
 </router-link></div>

css:

.issue-tags {  
  padding-bottom: 25px;  
  
 span {  
    margin-right: 15px;  
 padding: 6px 12px;  
 font-size: $small-font;  
 background: $theme-color;  
 color: #fff;  
 border-radius: 70px;  
 }  
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. 元素块状化->display: inline-block;[只要能块状化的都行->最好是用flex布局]
  2. 文本不断行->word-break: keep-all;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...