2018-03-01发表Tech / FrontEnd几秒读完 (大约99个字) 次访问如何实现flex布局下div等宽且内部文字可以溢出显示效果如图:HTML结构:123456789101112<div class="labels"> <div class="label"><span>1</span></div> <div class="label"><span>2</span></div> <div class="label"><span>3</span></div> <div class="label"><span>4</span></div> <div class="label"><span>Today</span></div> <div class="label"><span>6</span></div> <div class="label"><span>7</span></div> <div class="label"><span>8</span></div> <div class="label"><span>9</span></div> <div class="label"><span>10</span></div></div>CSS样式:12345678910111213141516171819202122232425262728293031.labels { display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; -webkit-align-items: center; -ms-flex-align: center; align-items: center; .label { -webkit-flex: 1; -ms-flex: 1; flex: 1; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; span { overflow: visible; position: absolute; line-height: 0; } }}如何实现flex布局下div等宽且内部文字可以溢出显示https://www.imaegoo.com/2018/flex-same-width-overflow/作者iMaeGoo发布于2018-03-01更新于2018-03-01许可协议CC BY 4.0#css