【问题标题】:align blog post in body to the left将正文中的博客文章向左对齐
【发布时间】:2019-07-31 02:41:30
【问题描述】:

我正在使用第三方模板。对于我的博客文章,桌面上的显示还可以。但在移动版本(平板电脑和手机)上,帖子正文是右对齐的。我希望它向左移动。

@media only screen and (max-width: 780px) {
.picsizer {
width: 100%;
}
.fullwrap {
  position: relative;
}
.post-outer {
width: 100%;
}
#stickyme {
    width: 100%;
}
.labelblog .post-outer {
    padding-left: 40px;
    padding-right: 40px;
}
}

    ~~~~<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-z541xJZy8o4/XT0QfBsglbI/AAAAAAAABKU/LcYLqVn4A1MMDRODOxLeewRDDasnVCq0gCKgBGAs/s1600/famous.png" imageanchor="1" ><img border="0" src="https://1.bp.blogspot.com/-z541xJZy8o4/XT0QfBsglbI/AAAAAAAABKU/LcYLqVn4A1MMDRODOxLeewRDDasnVCq0gCKgBGAs/s320/famous.png" width="320" height="320" data-original-width="636" data-original-height="636" /></a></div>
<link rel="stylesheet" href="https://s3.amazonaws.com/canvas-chess/source/pgn.min.css">
<script src="https://s3.amazonaws.com/canvas-chess/source/canvaschess-0.1.0.min.js"></script>
<script src="https://s3.amazonaws.com/canvas-chess/source/pgnviewer-0.1.0.min.js"></script>
<script>
    var viewer = new CHESS.PgnViewer({
        pgn_uri: 'https://s3.amazonaws.com/canvas-chess/pgn/lasker_capablanca_1921.pgn',
        piece_set: 'https://s3.amazonaws.com/canvas-chess/pieces/merida'
    });
</script>

....
I added in the html code. Here's the link to the full blog post. It was done a while back and I am doing a fixing of the website.

https://abigaildemo.blogspot.com/2018/10/four-move-checkmates.html

【问题讨论】:

  • 请发布您的相关代码,以及到目前为止您尝试过的内容。
  • 我们也需要html。
  • @takendarkk - 我将帖子添加到 html 中。

标签: html blogger


【解决方案1】:

让我试着回答这个问题。

您可以尝试添加:

text-align: left;

.post-outher

像这样:

@media only screen and (max-width: 780px) {
    .picsizer {
        width: 100%;
    }
    .fullwrap {
        position: relative;
    }
    .post-outer {
        width: 100%;
        text-align: left;
    }
    #stickyme {
        width: 100%;
    }
    .labelblog .post-outer {
        padding-left: 40px;
        padding-right: 40px;        
    }
}

或者因为你不能提供一个例子来说明如何将你的 CSS 代码实现为 HTML 代码。

@media only screen and (max-width: 780px) {
    .picsizer {
        width: 100%;
    }
    .fullwrap {
         position: relative;
    }
    .post-outer {
        width: 100%;
    }
    #stickyme {
        width: 100%;
    }
    .labelblog .post-outer {
        padding-left: 40px;
        padding-right: 40px;
        text-align: left;
    }
}

我希望这对你有用。

【讨论】:

  • 我尝试了您的解决方案,但我根本没有工作。手机上的帖子被截断了。
  • 您可以试试这个技巧:将padding-left:-15px 添加到.canvaschesspgn 类中,或者在您的博客模板上的&lt;/style&gt; 之前复制粘贴此代码.canvaschesspgn {padding-left:-15px;}
  • 这似乎对我有用,请关注ibb.co/GnWp7XL。不过,不接受也没关系。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-01-16
  • 1970-01-01
  • 2023-04-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多