【发布时间】:2017-12-21 22:40:30
【问题描述】:
我想在标题的 fc-content div 的末尾添加另一个显示数字的 div。问题是尽管将 display 设置为 block,但 title span 似乎不服从任何减小其宽度的尝试。它总是扩展到完整的 fc-content 宽度。
HTML
<div class="fc-content">
<span class="fc-title">I want to fit text to span's width</span>
<div class="number">128</div>
</div>
CSS
.fc-title{
display:block;
width:50%;
}
.number{
position: absolute;
left:82%;
top:0;
width:18%;
height:100%;
color:white;
text-align: center;
background-color: red;
}
我故意将 span 宽度设置为 50% 以显示 span 文本如何溢出。有没有不使用javascript的解决方案;
【问题讨论】:
标签: css fullcalendar