简体   繁体   English

如何在 Blogger 中居中我的帖子和页面?

[英]How can I center my posts and pages in blogger?

I want to center my blog body (Posts and Pages) in blogger, its a custom template Link: www.temsah.ga我想将我的博客正文(帖子和页面)放在博客中,它是一个自定义模板链接: www.temsah.ga

I tried adding this code below </b:skin> :我尝试在</b:skin>下方添加此代码:

    <style>
#sidebar-atas1
{
display: none;
}
#main-wrapper
{
width: 100%; background:#fff;
}
</style>

It removed the sidebar successfully but it didn't center my body.它成功移除了侧边栏,但它没有使我的身体居中。

I checked your website.我检查了你的网站。 The issue is that your template provides space for the sidebar.. Set your .portfolio-wrap width to 100%.问题是您的模板为侧边栏提供了空间。将您的.portfolio-wrap宽度设置为 100%。 That should fix it.那应该解决它。

.portfolio-wrap {
    width: 100%;
}

Here you have a div that should contain all the html you want to center在这里你有一个 div 应该包含你想要居中的所有 html

     <div class="center">
       /*Your html goes here*/
    </div>

And Here is the css for it这是它的css

.center {
  margin: auto;
  width: 95%;
  padding: 10px;
}

Hope that helps.希望有帮助。

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

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