
.wrap { wIDth: 300px; display: table;}.header { display: table-header-group;}.first { display: table-cell; background: red; padding: 10px;}.second { display: table-cell; background: green; padding: 10px;}.third { display: table-cell; background: blue; padding: 10px;} <div > <span >header</span> <span >First</span> <span >Second</span> <span >Third</span></div>
https://jsfiddle.net/kn8b20p3/
如果您检查“标题”,它似乎填满整个100%宽度,但如果有更多文本或背景颜色,它只会扩展到第一列.
有没有办法让它覆盖所有三列,如真正的标题,而不进一步嵌套跨度?
解决方法 如果你真的想使用表的属性来代替你的.header { display: table-header-group; }
使用
总结.header { display: table-caption; }
以上是内存溢出为你收集整理的html – 使用表属性创建全角标题全部内容,希望文章能够帮你解决html – 使用表属性创建全角标题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)