我试图在div[display=table-cell]
中显示100%高度的iframe,但代码不起作用。只有当我给予父div的固定高度时,该工作才有效,但是contact-form的高度必须是动态的,并且始终为#contact-map
高度必须为#contact-form
高度。我究竟做错了什么?如何填写#contact-map
内的iframe?如何在div中填充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>
为什么会出现在那里YouTube视频? –
@TimothyGroote当您尝试添加“https:// www.google.com”时,它会触发此错误“拒绝在框架中显示'https://www.google.com',因为它将'X-Frame -Options'to'sameorigin'。 –
与YouTube视频相同; –