所以在我网站的底部,我有一个带有谷歌地图的div部分,下面应该是文字,说明电子邮件地址和物理地址(业务)。
不幸的是,该文本被随机推送到底部,如本网站最底部所示:
http://website.sme.sh.s3-website-eu-west-1.amazonaws.com
以下是我认为影响它的代码 -
.page {
display: inline-block;
min-height: 100vh;
background-size: cover;
background-position: center;
width: 100vw;
text-align: center;
margin: auto;
}
.flex-container {
height: 100vh;
display:flex;
align-items:center;
justify-content:center;
}
.map {
width: 60%;
height: 50%;
min-width: 20em;
}
<div class="page get-in-touch">
<div class="flex-container">
<div class="map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2482.2326378518164!2d-0.08973764855540126!3d51.52729277953841!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x48761ca5df3ab397%3A0xb76b90b168bccd4d!2sSmesh!5e0!3m2!1sen!2suk!4v1528291922909" width="100%" height="100%" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
<a href="mailto:hello@sme.sh" style="color: #000;"><u>hello@sme.sh</u></a> <a style="color: #000;"> | 20 East Road, London, N1 6AD</a>
</div>
我的代码中是否有遗漏的内容?
答案 0 :(得分:0)
这是由于您的<a href="mailto:"></a>
标记和您的地址标记位于flex-container
类之外。
要修复,请将两个<a>
标记放在flex-container
类中,并将它们放在您想要的位置。
或者,减少height
班级的flex-container
答案 1 :(得分:0)
试试这个......
.page {
display: inline-block;
min-height: 100vh;
background-size: cover;
background-position: center;
width: 100vw;
text-align: center;
margin: auto;
}
.flex-container {
height: 100vh;
display:flex;
align-items:center;
justify-content:center;
}
.map {
width: 60%;
height: 50%;
min-width: 20em;
}
&#13;
<div class="page get-in-touch">
<div class="flex-container">
<div class="map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2482.2326378518164!2d-0.08973764855540126!3d51.52729277953841!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x48761ca5df3ab397%3A0xb76b90b168bccd4d!2sSmesh!5e0!3m2!1sen!2suk!4v1528291922909" width="100%" height="100%" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
<p><a href="mailto:hello@sme.sh" style="color: #000;"><u>hello@sme.sh</u></a> <a style="color: #000;"> | 20 East Road, London, N1 6AD</a></p>
</div>
</div>
&#13;
答案 2 :(得分:0)
实际上,它不是随机的。由于您在flex-container
标记之前有<a>
,因此该文本应该在那里。在flex-container
内,50%
中只有地图height
,因此当您有不同的屏幕/分辨率时,它会让您感觉像是随机的。
您可以在<a>
内移动flex-container
,也可以在100%
height
.page {
display: inline-block;
min-height: 100vh;
background-size: cover;
background-position: center;
width: 100vw;
text-align: center;
margin: auto;
}
.flex-container {
height: 100vh;
display:flex;
align-items:center;
justify-content:center;
}
.map {
width: 60%;
height: 100%;
min-width: 20em;
}
&#13;
<div class="page get-in-touch">
<div class="flex-container">
<div class="map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2482.2326378518164!2d-0.08973764855540126!3d51.52729277953841!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x48761ca5df3ab397%3A0xb76b90b168bccd4d!2sSmesh!5e0!3m2!1sen!2suk!4v1528291922909" width="100%" height="100%" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
<a href="mailto:hello@sme.sh" style="color: #000;"><u>hello@sme.sh</u></a> <a style="color: #000;"> | 20 East Road, London, N1 6AD</a>
</div>
&#13;
答案 3 :(得分:0)