字段集高度为其父级的100% [英] Fieldset height 100% of its parent

查看:171
本文介绍了字段集高度为其父级的100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个< div> 包含的 fieldets ,我们称它们为 blah1 blah2



blah2 可以增加其< div> parent,但我需要 blah1 具有相同的%兄弟的高度 blah2



这是我的演示

解决方案

答案很奇怪,但我使它工作,看起来像边缘在这里混乱,如果我设置为 margin:0 5px; 然后我可以使两个 fieldsets 具有相同的 height / p>

css 标记的一部分:

  fieldset 
{
border:1px solid #ddd;
padding:0 1.4em 1.4em 1.4em;
margin:0 0 1.5em 0;
border-radius:8px;
margin:0 5px;
height:100%;
}

legend
{
font-size:1.2em;
font-weight:bold;
}
.blahContainer {
width:100%;
height:100%;
}

.blahColumna1 {
width:70%;
height:100%;
}



如果你想看最后的演示,点击这里



希望它可以帮助别人...


I have 2 fieldsets wrapped in a <div>, let's call them blah1 and blah2.

blah2 can grow as the max of its <div> parent, but I need blah1 to have the same % height of his sibling blah2

This is my demo

解决方案

The answer was kinda weird, but I make it work, looks like the margin was making a mess here, if I set it to margin: 0 5px; then I can make both fieldsets to have the same height as their parent

Part of the css markup:

fieldset
{
    border: 1px solid #ddd;
    padding: 0 1.4em 1.4em 1.4em;
    margin: 0 0 1.5em 0;
    border-radius: 8px;
    margin: 0 5px;
    height: 100%;
}

legend
{
    font-size: 1.2em;
    font-weight: bold;
}
.blahContainer{
    width: 100%;
    height: 100%;
}

.blahColumna1{
    width: 70%;
    height: 100%;
}

If you wanna see the final demo, click here.

Hope it can help somebody else...

这篇关于字段集高度为其父级的100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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