html 页码设计,html – 创建一个页脚结构,页脚底部和100%内容

我想为网页设计一个结构,但我有一个问题,我不能单独使用它.这就是我要的:

一个包含3个部分的网页:

1-header

2-content( has 2 parts, a sidebar and a content section)

3-footer

我想要这些特点:

1- if in the content section there is nothing then footer stays at the bottom, if we have content, footer pushes down and stays after my content

2- my sidebar(exist in the content section) take 100% height of content section and connects to footer

像这样:

我用这个代码构建它并且它可以工作,但我的问题是如果侧边栏区域的内容变大,侧边栏和主要内容区域重叠页脚!我希望在这种情况下,页脚会停留在我的内容之后.

我使用Twitter Bootstrap来完成我的工作.我不想使用仅在新浏览器中可用的方法.至少IE 9.

这是我的代码:

test
header
content

这是CSS:

body,html{

height: 100%;

}

.container-fluid {

height:100%;

}

.header{

background-color: #ccff55;

}

.content{

background-color: #445566;

height: -webkit-calc(100% - 10%);

}

.sidebar{

background-color: #446655;

height: 100%;

}

.footer{

background-color: #11ff99;

}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值