【发布时间】:2018-01-19 21:48:37
【问题描述】:
我正在尝试以 100% 的高度在 div[display=table-cell] 中显示 iframe,但代码不起作用。仅当我为父 div 提供固定高度时才有效,但联系表单的高度必须是动态的,并且始终 #contact-map 高度必须像 #contact-form 高度。我究竟做错了什么?如何在#contact-map内填充iframe?
textarea {
max-width: 800px;
max-height: 250px;
}
.contact {
width: 100%;
min-height: 543px;
display: table;
}
#contact-map {
height: 100%;
display: table-cell;
}
#contact-form {
background-color: blue;
display: table-cell;
width: 43%;
}
<div class="contact">
<div id="contact-form">
<p id="contact-street">text-text</p>
<p id="contact-emailto">text-text</p>
<p id="contact-telephone">123123</p>
<textarea name="contact_message" id="contact_message"></textarea>
</div>
<div id="contact-map">
<iframe src="http://google.com" width="100%" height="100%" frameborder="0" allowfullscreen=""></iframe>
</div>
</div>
【问题讨论】:
标签: html css iframe height css-tables