컨테이너 (래퍼) 2 개의 컨테이너 행이 있고 두 행의 높이 값을 자동으로 지정하여 그 안에 내용에 따라 동적으로 크기를 조정할 수 있습니다. 행 높이 46 %, 행 하단 54 %). 하단 행 컨테이너의 높이를 자동으로 CSS (* JavaScript가 아닌)로 화면에 채우려 고합니다. 아래 첨부 된 이미지에서 원하는 결과를 확인하십시오. 제발 조언을 해줘. 고마워.컨테이너 행 높이 자동 채움/CSS로 조정
Click here for preview at JSfiddle
HTML
<div id="content-wrapper">
<div id="row-top">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</div>
<div id="row-bottom">
<iframe id="gmap"></iframe>
</div>
</div>
CSS
#content-wrapper {
display:block;
height:100%;
overflow-y: scroll;
width:600px;
float:left;
background-color:yellow;
}
#row-top {
color:#fff;
display:block;
position:relative;
width:100%;
height:auto;
background-color:blue;
}
#row-bottom {
display:block;
width:100%;
height:auto;
}
iframe#gmap {
overflow: hidden;
height:100%;
width: 100%
}
Click here for preview at JSfiddle
의도 된 결과 :
들으 (크롬 만 파이어 폭스에서 테스트), 정말 감사드립니다. 그러나 그것은 그 일을 더하기 (녹색 행) 얻을 수있는 두 행의 컨테이너에 대한 특정 높이를 설정해야합니다 때문에 내가 달성하려고 노력하고있는 아니에요 남아있는 간격을 채우지 않습니다. 화면 하단. 추신 firefox 25와 chrome 31에서 테스트되었습니다. – wei
코드에서와 같이'height'를'100 %'로 설정할 수도 있습니다. 당신이 목표로하는 것이 아닙니까? 결과는 다음과 같습니다. http://jsfiddle.net/Q4uC8/2/ –
네, 맞습니다. 나는 html, body가 높이로 설정되지 않았기 때문에 앞에서 언급 한 것처럼 작동하지 않는 이유가 100 %라고 생각합니다. jsfiddle에서 100 %. 정말 고맙습니다. 불행히도 이것은 10 이하 IE에서 작동하지 않습니다 내가 열을 같은 달성하기 위해 트릭을 찾을 수 있다고 생각. – wei