Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何使div使用水平导航和页脚之间的100%高度_Css_Html_Wrapper_Footer - Fatal编程技术网

Css 如何使div使用水平导航和页脚之间的100%高度

Css 如何使div使用水平导航和页脚之间的100%高度,css,html,wrapper,footer,Css,Html,Wrapper,Footer,我一直在寻找这个问题,并尝试了本页给出的每一个解决方案,但由于某种原因,我还没有找到为什么给出的解决方案在我的项目中不起作用 我需要左包装和右包装使用100%的高度,也需要页脚始终在底部 这是我的密码: HTML 您必须在css中进行更改…例如左列位置:绝对,其父列位置:相对。没错,就是这样,你会得到你想要得到的 html{ 保证金:0; 填充:0; 身高:100%; } 身体{ 字体系列:无衬线; 背景色:ccc; 保证金:0; 字号:0.9em; 身高:100%; } .global_包装

我一直在寻找这个问题,并尝试了本页给出的每一个解决方案,但由于某种原因,我还没有找到为什么给出的解决方案在我的项目中不起作用

我需要左包装和右包装使用100%的高度,也需要页脚始终在底部

这是我的密码:

HTML


您必须在css中进行更改…例如左列位置:绝对,其父列位置:相对。没错,就是这样,你会得到你想要得到的

html{ 保证金:0; 填充:0; 身高:100%; } 身体{ 字体系列:无衬线; 背景色:ccc; 保证金:0; 字号:0.9em; 身高:100%; } .global_包装器{ 宽度:90%; 背景色:透明; 保证金:0自动; 最小高度:100%; 位置:相对位置; } 标题{ 宽度:100%; 高度:100px; 保证金:0自动; 背景颜色:橙色; } 标题img.logo{ 浮动:左; 最大高度:50px; 最大宽度:140像素; 边缘顶部:25px; 左边距:25px; } 导航菜单水平{ 宽度:100%; 保证金:0自动; 高度:自动; 颜色:E1E1; 边界:0; 背景:0061a7; 文本对齐:居中; 垂直对齐:中间对齐; 线高:190%; } 北纬水平线{ 列表样式:无; 显示:内联; } 导航菜单水平a.项目1{ 文字装饰:无; 颜色:E1E1; 左侧填充:7px; 右侧填充:7px; 边框颜色:银色; } 导航菜单水平a.1项:悬停{ 背景:E1E1; 颜色:0061a7; 填充:7px; 边框左上半径:7px; 边框右上角半径:7px; -webkit过渡:背景色。30秒轻松输入输出; -moz过渡:背景色。30秒轻松输入输出; -o型过渡:背景色。30秒易进易出; 过渡:背景色。30秒轻松进出; } .content\u包装{ 宽度:100%; 保证金:自动; 填充底部:100px; 溢出:隐藏; 位置:相对位置; } .左_列{ 显示:块; 宽度:25%; 浮动:左; 背景色:de9e47; 填充:1.7%; 框大小:边框框; 位置:绝对位置; 身高:100%; } .对{ 显示:块; 宽度:75%; 浮动:对; 背景色:E1E1; 填充:1.7%; 框大小:边框框; 身高:100%; } 页脚{ 明确:两者皆有; 宽度:100%; 高度:100px; 保证金:0自动; 背景颜色:橙色; 文本对齐:居中; 底部:0; 左:0; 填充:2%; 框大小:边框框; 位置:绝对位置; } 伊兹基尔达酒店 海伦娜。 这是一个很好的例子。 杜拉·奥卡西翁·德坦托·达尼奥 mientras vencido Paris muere ardiendo酒店 德尔格里戈·文塞多·杜尔梅在巴西。 维加路。 阿奎
更改此..并提及.left_列的高度

css
一定要问一下,如果你觉得很难理解,为什么你不能用jquery来实现呢

剧本

<!DOCTYPE html>
<div class="global_wrapper">
<header>
<img src="imagenes/imagen.png" alt="logo" class="logo">
</header>
<nav class="menuhorizontal"> <strong>

  <li><a href="#.php" class="item1">Inicio</a></li>
  <li><a href="#.php" class="item1">cosa2</a></li>
  <li><a href="#.php" class="item1">cosa3</a></li>
  <li><a href="# 51.php" class="item1">&Aacuterea 51</a></li>
   </strong>

</nav>
<div class="content_wrapper">
    <div class="left_column">pendejadas a la izquierda</div>
    <div class="right_wrapper">A Helena.
        <br>
        <br>de que se ven rüinas y pedazos.
        <br>Y la dura ocasión de tanto daño
        <br>mientras vencido Paris muere ardiendo
        <br>del griego vencedor duerme en los brazos.
        <br>Lope de Vega.
        <br>
    </div>
</div>
<footer>Aquí</footer>
</div>
</body>

</html>
html {
margin: 0;
padding: 0;
height: 100%;
}
body {
font-family: sans-serif;
background-color: #ccc;
margin: 0;
font-size: 0.9em;
height: 100%;
}
.global_wrapper {
width: 90%;
background-color: transparent;
margin: 0 auto;
min-height: 100%;
position: relative;
}
header {
width: 100%;
height: 100px;
margin: 0 auto;
background-color:orange;
}
header img.logo {
float: left;
max-height: 50px;
max-width: 140px;
margin-top: 25px;
margin-left: 25px;
}
nav.menuhorizontal {
width:100%;
margin: 0 auto;
height: auto;
color: #e1e1e1;
border: 0;
background: #0061a7;
text-align: center;
vertical-align: middle;
line-height: 190%;
}
nav.menuhorizontal li {
list-style: none;
display: inline;
}
nav.menuhorizontal a.item1 {
text-decoration: none;
color: #e1e1e1;
padding-left: 7px;
padding-right: 7px;
border-color:silver;
}
nav.menuhorizontal a.item1:hover {
background: #e1e1e1;
color:#0061a7;
padding: 7px;
border-top-left-radius: 7px;
border-top-right-radius: 7px;
-webkit-transition: background-color .30s ease-in-out;
-moz-transition: background-color .30s ease-in-out;
-o-transition: background-color .30s ease-in-out;
transition: background-color .30s ease-in-out;
}
.content_wrapper {
width: 100%;
margin: auto;
padding-bottom: 100px;
overflow: hidden;
}
.left_column {
display: block;
width: 25%;
float: left;
background-color:#de9e47;
padding: 1.7%;
box-sizing: border-box;
}
.right_wrapper {
display: block;
width:75%;
float: left;
background-color: #e1e1e1;
padding: 1.7%;
box-sizing: border-box;
height: 100%;
}
footer {
clear:both;
width: 100%;
height: 100px;
margin: 0 auto;
background-color:orange;
text-align: center;
bottom: 0;
left: 0;
padding: 2%;
box-sizing: border-box;
position: absolute;
}
.content_wrapper {
width: 100%;
overflow: scroll;
position: absolute;
height: 49%;/*increase it as you need*/
}
$(document).ready(function () {
    changeHeight();
    window.resize();
    $(window).resize(function () {
        changeHeight();
    });
});
$(document).change(function () {
    changeHeight();
});

function changeHeight() {
    $(".left_column, .right_wrapper").css({
        "height": "100%"
    });
    var headerHeight = $("header").height();
    var navHeight = $(".menuhorizontal").height();
    var footerHeight = $("footer").height();
    var bodyHeight = $('body').height();
    var wrapperHeight = (bodyHeight - (headerHeight - navHeight - footerHeight));
    console.log(wrapperHeight);
    $(".content_wrapper, .left_colulmn, .right_wrapper").height(wrapperHeight);
}