我最近购买了这个主题。我想通过在主页中显示元素来自定义主题文件,即出现的帖子列表是四个,我想做的是连续三个。是否可以使用 css 或 jquery 来做到这一点。 这是主题的链接 在主页中,您可以看到帖子有四个(我希望它是三个) <强> Here is the link
是否可以使用 css 将列表设为三个?
最佳答案
元素 1:要限制每行显示的 block 数,请增加每个元素的宽度,如下所示:
.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 项:要使图像在每个 block 中居中,请添加 margin
,如下所示:
.articles .thumb {
width: 228px;
height: 108px;
margin: 0px auto; /*added this line to center image horizontally.*/
}
关于jquery - 我怎样才能使列表项连续三个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19160576/