我最近购买了这个主题。我想通过在首页中显示项目来自定义主题文件,即帖子出现的列表是四个,我想连续三个。是否有可能使用css或jquery做到这一点。
这是主题的链接
在首页中,您可以看到该帖子为四(我希望它为三)
Here is the link

是否可以使用CSS将列表设为三个?

最佳答案

第1项:要限制每行显示的块数,请增加每个项目的宽度,如下所示:

.articles li {
    padding: 7px;
    width: 30%; /*This can be in px also. If in px give a value roughly above 290px. */
    text-align: left;
    position: relative;
    float: left;
    min-height: 210px;
    margin: 0 3px 5px 1px;
}


第2项:要将图像居中放置在每个块中,请添加margin,如下所示:

.articles .thumb {
    width: 228px;
    height: 108px;
    margin: 0px auto; /*added this line to center image horizontally.*/
}

10-08 08:45
查看更多