简体   繁体   English

如何解决这个wordpress主题中帖子的对齐问题

[英]How to fix the alignment issue of posts in this wordpress theme

I am using w3school's w3css for this website and I have used the w3-col l6 m6 s12 for displaying the posts. 我在这个网站上使用w3school的w3css,我使用了w3-col l6 m6 s12来显示帖子。 It simply means that it will show 2 post side by side on large screen, same for the medium side display and only one covering all the 12 column on small screens. 它只是意味着它将在大屏幕上并排显示2个帖子,中间侧显示器相同,只有一个覆盖小屏幕上的所有12列。

But the posts are not aligning properly. 但帖子没有正确对齐。

I tried adding the height property as auto but it's not working. 我尝试将height属性添加为auto但它不起作用。

Check out this demo site that I have uploaded on my website so that you can see it in action. 查看我在我的网站上上传的演示网站,以便您可以看到它的实际效果。

http://wordpress.takshaksh.xyz/wp/ http://wordpress.takshaksh.xyz/wp/

网站在网上直播

Please add below code in style.css 请在style.css中添加以下代码

div.w3-row-padding {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

or add new class in w3-row-padding like col_wrap and apply below style 或者像col_wrap一样在w3-row-padding中添加新类,并在样式下面应用

.col_wrap {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}
.col_wrap:after,
.col_wrap:before { display:none;}

You can add this CSS your parent container on w3-col l6 m6 s12 你可以在w3-col l6 m6 s12上添加这个CSS你的父容器

.w3-row-padding{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
 }

您可以通过每<div class="w3-row-padding w3-row">只有2个项来解决这个问题。

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

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