html - 如何用html+css做这样的布局?

标签 html css

enter image description here

框是一些对象(按钮、标签、文本区域)。格林的尺寸是动态的。特别是我有一个蓝色盒子粘在底部的问题。

最佳答案

在它周围放置一个支架,它将从“绿色”高度开始,并只给它们绝对和底部 0,你给元素的宽度无关紧要。

编辑:希望这对你有用, float 元素,绿色的在右边,其余的在左边。

<div id="divHolder">
<label id="red">Label</label>
<button id="blue">Button</button>
<div id="green">
    a
    </div>
    <br class="clearFloat" />
</div>

#divHolder {
    width:300px;
    position:relative;

}
#green {
    height:300px;
    background-color: green;
    float:right;
}
#red {
    background-color:red;
     float:left;
    position:absolute;
}
#blue {
    background-color: blue;
    bottom: 0;
    position:absolute;
}
.clearFloat {
 clear:both;   
}

在这里查看: http://jsfiddle.net/YA9yD/32/

关于html - 如何用html+css做这样的布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5519944/

相关文章:

html - 如何将我的页脚推到右栏菜单的下方

css - 怎么把文字放在中间

css - 绘制图像并用颜色或图案动态填充它

jQuery 视差滚动在手机/平板电脑上禁用

javascript - 收到一个奇怪的 jquery 错误,我无法弄清楚

javascript - 表单输入不接受空格

css - 具有 % 宽度和 px 边框的 div

javascript - html 选择 - 范围为 0-10

html - Margin 顶部菜单移动内容

HTML & CSS 背景