1
I have the following Section, and I need the Divs to be centered horizontally on my Boostratp 3 Grid. It always stays on the Left side and I can’t change that.
<section id="servicos">
<div class="container">
<h5>Hospedagem</h5>
<div class="row">
<div class="col-sm-6" style="border: 1px solid red">
<div align="center" class="airbnb-embed-frame" data-id="16409839" data-view="home" style="width:100%;height:500px;"><a href="https://www.airbnb.com.br/rooms/16409839?s=51"><span>Ver no Airbnb</span></a><a href="https://www.airbnb.com.br/rooms/16409839?s=51" rel="nofollow">Flat com 28 m2 mobiliado com excelente localização</a><script async="" src="https://www.airbnb.com.br/embeddable/airbnb_jssdk"></script></div>
</div>
<div class="col-sm-6" style="border: 1px solid red">
<div align="center" class="airbnb-embed-frame" data-id="16409839" data-view="home" style="width:100%;height:500px;"><a href="https://www.airbnb.com.br/rooms/16409839?s=51"><span>Ver no Airbnb</span></a><a href="https://www.airbnb.com.br/rooms/16409839?s=51" rel="nofollow">Flat com 28 m2 mobiliado com excelente localização</a><script async="" src="https://www.airbnb.com.br/embeddable/airbnb_jssdk"></script></div>
</div>
</div>
<div class="mais-hospedagem" style="border: 1px solid red">
<button class="btn btn-custom btn-roxo btn-lg bt-destino mais-hospedagem"><b>mais hospedagens</b></button>
</div>
</div>
</div>
</section>
I try to use the following CSS:
.airbnb-embed-frame{
text-align: center;
color: white;
display: table-cell;
vertical-align: middle;
}
Thank you so much, Hugo. I’m trying to solve this. =)
– Vinicius Martins
@Viniciusmartins good young, just remember to do the responsive part as the Media in the screen widths you need, so do not keep cutting the iframe and it is centered cute. good luck there
– hugocsl
@Viniciusmartins face the same problem is this iframe... I do not know if you have how to configure it before importing on the page. But if you inspect it you will find that class ". _xlzko7", she sets his width at 426px, so it will never get smaller than that and will always cut a piece. Maybe you have some Airb&b API documentation that can help you with that. To make matters worse as far as I know you can’t change the imported CSS inside an iframe unfortunately.
– hugocsl