jav*_*nus 2 html css position fixed-length-record css-float
我的页面由4个div组成:顶部是标题,中间是菜单div和内容div,底部是页脚div。
页脚应固定在屏幕底部。我希望内容 div 将从页眉 div 拉伸到页脚 div。如果我使用
position: absolute;
top: 80px;
bottom: 30px;
Run Code Online (Sandbox Code Playgroud)
然后内容被拉伸到页脚,但之后内容不会向右拉伸。请检查下面的代码。我希望红色的内容从绿色垂直延伸到黄色,从蓝色水平延伸到屏幕的右边缘。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><tiles:insertAttribute name="title" ignore="true" /></title>
<style>
html,body{
margin:0;
padding:0;
height:100%;
}
#javanus_header{
height: 80px;
background:#AAF054;
}
#javanus_footer{
position:absolute;
bottom:0;
width:100%;
height:30px;/* Height of the footer */
background: yellow;
}
#javanus_menu{
float: left;
position: absolute;
top: 80px;
height:200px;
width: 200px;
background: blue;
}
#javanus_content{
height: 300px;
margin-left: 200px;
background: red;
top:100px;
bottom:50px;
background-image:url(img/assist.png);
background-repeat: no-repeat;
background-position:center;
}
</style>
</head>
<body>
<div id="javanus_main">
<div id="javanus_header">
</div>
<div id="javanus_body">
<div id="javanus_menu">
</div>
<div id="javanus_content">
</div>
</div>
<div id="javanus_footer">
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
最好的问候,爪哇努斯
归档时间: |
|
查看次数: |
4246 次 |
最近记录: |