如何将js时钟与页面中心对齐?

Lee*_*Lee 2 css image center

如何将javascript倒计时框与页面中心对齐?网址是js所在的网址是http://www.freelanceseohelp.com/offer/mobile/index.html

我尝试调整以下内容,但我遇到了问题:

.flip-clock-wrapper {
Run Code Online (Sandbox Code Playgroud)

我尝试将以上内容添加到

<div class="clock"></div> 
Run Code Online (Sandbox Code Playgroud)

任何帮助解决这个问题将不胜感激.谢谢.

Jon*_*hon 15

我在这里参加派对的时间已经很晚了,但在撰写本文时,以下内容适用于我(版本:0.7.4 Beta).我的想法是将它包装在一个容器中并覆盖它的一些CSS.

HTML

<div class="container">
    <div class="flip-clock"></div>
    <!-- Flip clock is attached the this element, not .container -->
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.container {
    text-align: center;
}

.flip-clock {
    display: inline-block;
    width: auto;
}
Run Code Online (Sandbox Code Playgroud)

默认情况下.flip-clockwidth: 100%display: block.通过设置width: auto,display: inline-block项目不再跨越其父级的宽度,并且可以通过添加text-align: center到其容器来居中.