CSS为“填充父?” [英] CSS for "fill parent?"

查看:238
本文介绍了CSS为“填充父?”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DOM上的项目,我想填充它的父项宽度,不管是什么:

I have an item on the DOM that I'd simply like to have fill its parent's width, regardless of what that is:

<div width="800">
    <div class="filler"></div>
</div>

如何在CSS中指定 filler class匹配其父类的宽度?

How can I specify in CSS that the filler class match the width of its parent?

.filler {
    ?
}


推荐答案

c $ c> width:100%; ?

Have you tried: width: 100%; ?

这篇关于CSS为“填充父?”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆