在移动或便携式设备上查看应用程序时如何对齐版权页脚中心

时间:2018-11-16 15:42:34

标签: html css twitter-bootstrap

我在页脚中有版权信息,但是在便携式设备上查看时它保持对齐,但是在普通笔记本电脑屏幕中其居中对齐,有一种方法可以使它在所有设备上居中对齐

<!-- Footer -->
<footer>
    <!-- Copyright -->
    <div class="footer-copyright text-center py-3">
        © 2018 Copyright:  Virginia System of Care - VASOC
    </div>
    <!-- Copyright -->
</footer>
<!-- Footer -->

与下面的代码有什么关系

@media screen and (max-width: 768px) {

}

2 个答案:

答案 0 :(得分:1)

请记住,将文本放入非文本标签中不是一个好习惯。

footer{
width:100%;
}
.footer-copyright{
width:100%;
text-align: center;
}

答案 1 :(得分:0)

如果您想要相对屏蔽:

.footer-copyright{position: relative; left: auto; right: auto; margin: 0 auto;}

如果要绝对阻止:

.footer-copyright{position: absolute; left: 0; right: 0; margin: 0;}

或者只是设置

.footer-copyright{width:100%; max-width: 100%; text-align: center;}