简体   繁体   English

如何使 WordPress 上的页脚以移动设备为中心对齐,但在桌面和平板电脑视图上对齐

[英]How to make a footer on WordPress align centered on mobile but on one line on desktop and tablet view

I am trying to make my footer on one line on desktop and centered on mobile.我试图在桌面上的一行上制作我的页脚,并以移动设备为中心。 However, the picture on the footer is aligned left and not center on mobile.但是,页脚上的图片在移动设备上向左对齐而不是居中。 I'm wondering any tips on how to fix this issue.我想知道有关如何解决此问题的任何提示。 Here is the code that I currently have for the site:这是我目前拥有的网站代码:

hose don't seem to make a change.软管似乎没有改变。 Any tips are appreciated任何提示表示赞赏

Here's a couple of tweaks I ran and got it to work in the browser when going to your site.这是我运行的一些调整,并在访问您的网站时使其在浏览器中工作。

For desktop CSS:对于桌面 CSS:

.nonprofit {
    font-weight: bold;
    font-size: 15px;
    color: white;
    /* padding-left: 200px; */ // remove this
    display: block;
    align: right;
    float: left; // Keep this in there
    width: 50%; // Do this instead of width 100%
}

For your mobile CSS:对于您的移动 CSS:

@media only screen and (max-width: 768px)
.nonprofit {
    font-weight: bold;
    font-size: 15px;
    color: white;
    display: inline;
    padding: 10px;
    /* float: left; */ // remove this
    width: 100%; // add this
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM