无法将div放在响应式网站上的另一个div中

时间:2015-12-09 06:50:06

标签: html css

我在一些其他div中放置了一个名为fb-page的div类,我试图让它保持居中,因为浏览器的宽度会发生变化。我可以让它保持居中,直到关闭图标到达页面顶部并且浏览器宽度变为<768px - 当发生这种情况时fb-page向左移动并且不再居中。

HTML

CSS

如何解决此问题?

由于

2 个答案:

答案 0 :(得分:0)

<div id ="about" class="impala-prev impala-wrap-about animated impala-page">
                <div class="impala-scroll-overlay">
                        <div class="container-about">
                                <div class="block-nav">
                                        <a href="#home" class="btn-nav btn-home" data-panel="#home">
                                                <img width="20" height="20" src="img/svg/close-icon.svg" alt="close-icon">                                             
                                        </a>
                                </div>
                                <div class="container">
                                        <div class="row block-about">
                                                <div class="col-md-12 col-sm-12 col-xs-12">
                                                        <h2>About Us</h2>
                                                        <!--<h6><i>Welcome to A Vida Local (A Local Life)</i></h6>-->
                                                        <p>We are a new start-up that aims to enhance your travel experiences. A Vida Local is a community that connects those visiting Australia with the people that know it best, the locals that live there.
<br><br>
Experience Local - have a Local provide you with a unique local experience
<br>
Virtual Local - have a Local provide advice and support before your trip and while you are away.
</p>


                                                        <div class="fb-page" data-href="https://www.facebook.com/avidalocal" data-tabs="timeline" data-width="500" data-height="700" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/avidalocal"><a href="https://www.facebook.com/avidalocal">A Vida Local</a></blockquote></div></div>


                                                </div>                         
                                        </div>         
                                </div>

答案 1 :(得分:0)

为什么不在你的div中添加align = "center" ..

<div class="fb-page" data-href="https://www.facebook.com/avidalocal" data-tabs="timeline" data-width="500" data-height="700" data-small-header="false"  data-adapt-container-width="true" align = "center" data-hide-cover="false" data-show-facepile="true">