高度自动CSS属性 [英] height auto CSS property

查看:91
本文介绍了高度自动CSS属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是asp.net中的一个CSS问题。

我有一个被容器div包围的页面。这包含contenthome div,里面有flashhome div。

容器和contenthome height属性设置为auto。但是当我增加闪光灯高度时,容器和内容高度不会相应地改变。如何根据房屋高度实现自动增加和减少容器和内容高度。

我在下面插入了CSS代码。



This is a CSS question in asp.net.
I have a page which is surrounded by container div. This contains contenthome div, with flashhome div inside it.
Container and contenthome height property is set to auto. But when I increase flashhome height, container and contenthome height is not changed accordingly. How can I achieve autoincrease and decrease of container and contenthome heights depending on flashhome height.
I have inserted CSS code below.

#container {
    width: 750px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    border:1px;
    border-color: #b7b7b7;
    border-style: solid;
}
#contentHome {
    width: 750px;
    height: auto;
    position: relative;
    display: block;
    overflow: hidden;
}
#flashHome {
    float: left;
    display: block;
    width:485px;
    height: 255px;
    margin-left: 15px;
    margin-top: 5px;
}

推荐答案

您好b $ b

我只是为您的查询创建小提琴。



http://jsfiddle.net/L4GDt/ [ ^ ]



Flash Home div中的更改。



Hi
Just i create fiddle for your query.

http://jsfiddle.net/L4GDt/[^]

Changes in the Flash Home div.

#flashHome {
    position: relative;
    display: block;
    width:485px;
    height: 255px;
    margin-left: 15px;
    margin-top: 5px;
    background:#f00;
}


这篇关于高度自动CSS属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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