栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

用CSS调整div来填充父容器的宽度

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

用CSS调整div来填充父容器的宽度

在此线程中查看三十点的答案,以获得不带Javascript的纯CSS / HTML解决方案,该解决方案可在 包括IE 6在内的 所有浏览器中使用。

HTML:

<div id="container">    <div ></div>    <div ></div>    <div ></div>    <div ></div>    <span ></span></div>​

CSS:

#container {    border: 2px dashed #444;    height: 125px;    text-align: justify;    -ms-text-justify: distribute-all-lines;    text-justify: distribute-all-lines;        min-width: 612px;}.box1, .box2, .box3, .box4 {    width: 150px;    height: 125px;    vertical-align: top;    display: inline-block;    *display: inline;    zoom: 1}.stretch {    width: 100%;    display: inline-block;    font-size: 0;    line-height: 0}.box1, .box3 {    background: #ccc}.box2, .box4 {    background: #0ff}



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/615224.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号